zipentry_p.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /****************************************************************************
  2. ** Filename: ZipEntryP.h
  3. ** Last updated [dd/mm/yyyy]: 27/03/2011
  4. **
  5. ** Wrapper for a ZIP local header.
  6. **
  7. ** Some of the code has been inspired by other open source projects,
  8. ** (mainly Info-Zip and Gilles Vollant's minizip).
  9. ** Compression and decompression actually uses the zlib library.
  10. **
  11. ** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
  12. **
  13. ** This file is part of the OSDaB project (http://osdab.42cows.org/).
  14. **
  15. ** This file may be distributed and/or modified under the terms of the
  16. ** GNU General Public License version 2 as published by the Free Software
  17. ** Foundation and appearing in the file LICENSE.GPL included in the
  18. ** packaging of this file.
  19. **
  20. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  21. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  22. **
  23. ** See the file LICENSE.GPL that came with this software distribution or
  24. ** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
  25. **
  26. **********************************************************************/
  27. //
  28. // W A R N I N G
  29. // -------------
  30. //
  31. // This file is not part of the Zip/UnZip API. It exists purely as an
  32. // implementation detail. This header file may change from version to
  33. // version without notice, or even be removed.
  34. //
  35. // We mean it.
  36. //
  37. #ifndef OSDAB_ZIPENTRY_P__H
  38. #define OSDAB_ZIPENTRY_P__H
  39. #include <QtCore/QString>
  40. #include <QtCore/QtGlobal>
  41. OSDAB_BEGIN_NAMESPACE(Zip)
  42. class ZipEntryP
  43. {
  44. public:
  45. ZipEntryP() :
  46. lhOffset(0),
  47. dataOffset(0),
  48. gpFlag(),
  49. compMethod(0),
  50. modTime(),
  51. modDate(),
  52. crc(0),
  53. szComp(0),
  54. szUncomp(0),
  55. absolutePath(),
  56. fileSize(0),
  57. lhEntryChecked(false)
  58. {
  59. gpFlag[0] = gpFlag[1] = 0;
  60. modTime[0] = modTime[1] = 0;
  61. modDate[0] = modDate[1] = 0;
  62. }
  63. quint32 lhOffset; // Offset of the local header record for this entry
  64. mutable quint32 dataOffset; // Offset of the file data for this entry
  65. unsigned char gpFlag[2]; // General purpose flag
  66. quint16 compMethod; // Compression method
  67. unsigned char modTime[2]; // Last modified time
  68. unsigned char modDate[2]; // Last modified date
  69. quint32 crc; // CRC32
  70. quint32 szComp; // Compressed file size
  71. quint32 szUncomp; // Uncompressed file size
  72. QString comment; // File comment
  73. QString absolutePath; // Internal use
  74. qint64 fileSize; // Internal use
  75. mutable bool lhEntryChecked; // Is true if the local header record for this entry has been parsed
  76. inline bool isEncrypted() const { return gpFlag[0] & 0x01; }
  77. inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; }
  78. };
  79. OSDAB_END_NAMESPACE
  80. #endif // OSDAB_ZIPENTRY_P__H