FFSM++  1.1.0
French Forest Sector Model ++
unzip.cpp File Reference
#include "unzip.h"
#include "unzip_p.h"
#include "zipentry_p.h"
#include <QString>
#include <QStringList>
#include <QDir>
#include <QFile>
#include <QCoreApplication>
#include <QtDebug>
Include dependency graph for unzip.cpp:

Go to the source code of this file.

Macros

#define UNZIP_LOCAL_HEADER_SIZE   26
 Local header size (excluding signature, excluding variable length fields) More...
 
#define UNZIP_CD_ENTRY_SIZE_NS   42
 Central Directory file entry size (excluding signature, excluding variable length fields) More...
 
#define UNZIP_DD_SIZE   12
 Data descriptor size (excluding signature) More...
 
#define UNZIP_EOCD_SIZE   22
 End Of Central Directory size (including signature, excluding variable length fields) More...
 
#define UNZIP_LOCAL_ENC_HEADER_SIZE   12
 Local header entry encryption header size. More...
 
#define UNZIP_CD_OFF_VERSION   0
 
#define UNZIP_CD_OFF_GPFLAG   4
 
#define UNZIP_CD_OFF_CMETHOD   6
 
#define UNZIP_CD_OFF_MODT   8
 
#define UNZIP_CD_OFF_MODD   10
 
#define UNZIP_CD_OFF_CRC32   12
 
#define UNZIP_CD_OFF_CSIZE   16
 
#define UNZIP_CD_OFF_USIZE   20
 
#define UNZIP_CD_OFF_NAMELEN   24
 
#define UNZIP_CD_OFF_XLEN   26
 
#define UNZIP_CD_OFF_COMMLEN   28
 
#define UNZIP_CD_OFF_LHOFFSET   38
 
#define UNZIP_LH_OFF_VERSION   0
 
#define UNZIP_LH_OFF_GPFLAG   2
 
#define UNZIP_LH_OFF_CMETHOD   4
 
#define UNZIP_LH_OFF_MODT   6
 
#define UNZIP_LH_OFF_MODD   8
 
#define UNZIP_LH_OFF_CRC32   10
 
#define UNZIP_LH_OFF_CSIZE   14
 
#define UNZIP_LH_OFF_USIZE   18
 
#define UNZIP_LH_OFF_NAMELEN   22
 
#define UNZIP_LH_OFF_XLEN   24
 
#define UNZIP_DD_OFF_CRC32   0
 
#define UNZIP_DD_OFF_CSIZE   4
 
#define UNZIP_DD_OFF_USIZE   8
 
#define UNZIP_EOCD_OFF_ENTRIES   6
 
#define UNZIP_EOCD_OFF_CDOFF   12
 
#define UNZIP_EOCD_OFF_COMMLEN   16
 
#define UNZIP_VERSION   0x1B
 
#define UNZIP_VERSION_STRICT   0x14
 Full compatibility granted until this version. More...
 
#define CRC32(c, b)   crcTable[((int)c^b) & 0xff] ^ (c >> 8)
 CRC32 routine. More...
 
#define UNZIP_CHECK_FOR_VALID_DATA
 Checks if some file has been already extracted. More...
 

Macro Definition Documentation

#define CRC32 (   c,
 
)    crcTable[((int)c^b) & 0xff] ^ (c >> 8)

CRC32 routine.

Definition at line 136 of file unzip.cpp.

Referenced by UnzipPrivate::updateKeys().

#define UNZIP_CD_ENTRY_SIZE_NS   42

Central Directory file entry size (excluding signature, excluding variable length fields)

Definition at line 81 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_CMETHOD   6

Definition at line 92 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_COMMLEN   28

Definition at line 100 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_CRC32   12

Definition at line 95 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_CSIZE   16

Definition at line 96 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_GPFLAG   4

Definition at line 91 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_LHOFFSET   38

Definition at line 101 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_MODD   10

Definition at line 94 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_MODT   8

Definition at line 93 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_NAMELEN   24

Definition at line 98 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_USIZE   20

Definition at line 97 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_VERSION   0

Definition at line 90 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CD_OFF_XLEN   26

Definition at line 99 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_CHECK_FOR_VALID_DATA
Value:
{\
if (headers != 0)\
{\
qDebug() << "Corrupted zip archive. Some files might be extracted.";\
ec = headers->size() != 0 ? UnZip::PartiallyCorrupted : UnZip::Corrupted;\
break;\
}\
else\
{\
delete device;\
device = 0;\
qDebug() << "Corrupted or invalid zip archive";\
break;\
}\
}

Checks if some file has been already extracted.

Definition at line 139 of file unzip.cpp.

Referenced by UnzipPrivate::openArchive().

#define UNZIP_DD_OFF_CRC32   0

Definition at line 116 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_DD_OFF_CSIZE   4

Definition at line 117 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_DD_OFF_USIZE   8

Definition at line 118 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_DD_SIZE   12

Data descriptor size (excluding signature)

Definition at line 83 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_EOCD_OFF_CDOFF   12

Definition at line 122 of file unzip.cpp.

Referenced by UnzipPrivate::seekToCentralDirectory().

#define UNZIP_EOCD_OFF_COMMLEN   16

Definition at line 123 of file unzip.cpp.

Referenced by UnzipPrivate::seekToCentralDirectory().

#define UNZIP_EOCD_OFF_ENTRIES   6

Definition at line 121 of file unzip.cpp.

Referenced by UnzipPrivate::seekToCentralDirectory().

#define UNZIP_EOCD_SIZE   22

End Of Central Directory size (including signature, excluding variable length fields)

Definition at line 85 of file unzip.cpp.

Referenced by UnzipPrivate::seekToCentralDirectory().

#define UNZIP_LH_OFF_CMETHOD   4

Definition at line 106 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_CRC32   10

Definition at line 109 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_CSIZE   14

Definition at line 110 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_GPFLAG   2

Definition at line 105 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_MODD   8

Definition at line 108 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_MODT   6

Definition at line 107 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_NAMELEN   22

Definition at line 112 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_USIZE   18

Definition at line 111 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LH_OFF_VERSION   0

Definition at line 104 of file unzip.cpp.

#define UNZIP_LH_OFF_XLEN   24

Definition at line 113 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_LOCAL_ENC_HEADER_SIZE   12

Local header entry encryption header size.

Definition at line 87 of file unzip.cpp.

Referenced by UnzipPrivate::extractFile().

#define UNZIP_LOCAL_HEADER_SIZE   26

Local header size (excluding signature, excluding variable length fields)

Definition at line 79 of file unzip.cpp.

Referenced by UnzipPrivate::parseLocalHeaderRecord().

#define UNZIP_VERSION   0x1B

Max version handled by this API. 0x1B = 2.7 –> full compatibility only up to version 2.0 (0x14) versions from 2.1 to 2.7 may use unsupported compression methods versions after 2.7 may have an incompatible header format

Definition at line 131 of file unzip.cpp.

Referenced by UnzipPrivate::parseCentralDirectoryRecord().

#define UNZIP_VERSION_STRICT   0x14

Full compatibility granted until this version.

Definition at line 133 of file unzip.cpp.