#18 provide QuaZipNewInfo(const QuaZipFileInfo &existingInfo) ctor

pending
nobody
None
5
2014-02-09
2013-11-15
k-ziegler
No

It would be convenient if one could initialize a QuaZipNewInfo from an existing QuaZipFileInfo. All common attributes and the permissions should be copied.

Why is it necessary to distinguish between
QuaZipFileInfo::extra
and
QuaZipNewInfo::extraLocal
QuaZipNewInfo::extraGlobal
?
Does this impose any obstacles in implementing the feature?

Discussion

  • Sergey A. Tachenov

    What stops you from initializing with an existing structure? The default copy constructor is provided by the compiler and should work fine.

    I have no idea about the "extra" fields. They just reflect the back-end (minizip) API.

     
  • k-ziegler

    k-ziegler - 2013-11-15

    If I wanted to copy, copy ctor would be fine. Only I don't:
    QuaZipNewInfo != QuaZipFileInfo

    Indeed, I'd prefer one single info struct for both read/write access. However, I can't see how to accomplish this now without breaking compatibility. Adding another ctor should be painless.

     
    Last edit: k-ziegler 2013-11-15
  • Sergey A. Tachenov

    Oh, sorry, I didn't read it correctly. By "existing" I thought you meant "existing instance of QuaZipNewInfo".

    OK, I'll think about it. Mostly I'll have to deal with those extra fields, as I'm not sure what to initialize them with. I'll have to look deeper into the back-end source.

     
  • k-ziegler

    k-ziegler - 2013-11-17

    Thx, looking forward to it. :)

     
  • Sergey A. Tachenov

    I finally got to this. Looks like Minizip provides interface to write the extra field both to the local header and to the central directory. In the unzip mode, it only allows access to the one in the central directory, that's why this difference.

    I implemented a couple of new constructors that initialize QuaZipNewInfo from QuaZipFileInfo, copying the extra fields into both local and global.

     
  • Sergey A. Tachenov

    • status: open --> pending
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks