MythTV  master
Macros
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

◆ UNZIP_LOCAL_HEADER_SIZE

#define UNZIP_LOCAL_HEADER_SIZE   26

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

Definition at line 120 of file unzip.cpp.

◆ UNZIP_CD_ENTRY_SIZE_NS

#define UNZIP_CD_ENTRY_SIZE_NS   42

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

Definition at line 122 of file unzip.cpp.

◆ UNZIP_DD_SIZE

#define UNZIP_DD_SIZE   12

Data descriptor size (excluding signature)

Definition at line 124 of file unzip.cpp.

◆ UNZIP_EOCD_SIZE

#define UNZIP_EOCD_SIZE   22

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

Definition at line 126 of file unzip.cpp.

◆ UNZIP_LOCAL_ENC_HEADER_SIZE

#define UNZIP_LOCAL_ENC_HEADER_SIZE   12

Local header entry encryption header size.

Definition at line 128 of file unzip.cpp.

◆ UNZIP_CD_OFF_VERSION

#define UNZIP_CD_OFF_VERSION   0

Definition at line 131 of file unzip.cpp.

◆ UNZIP_CD_OFF_GPFLAG

#define UNZIP_CD_OFF_GPFLAG   4

Definition at line 132 of file unzip.cpp.

◆ UNZIP_CD_OFF_CMETHOD

#define UNZIP_CD_OFF_CMETHOD   6

Definition at line 133 of file unzip.cpp.

◆ UNZIP_CD_OFF_MODT

#define UNZIP_CD_OFF_MODT   8

Definition at line 134 of file unzip.cpp.

◆ UNZIP_CD_OFF_MODD

#define UNZIP_CD_OFF_MODD   10

Definition at line 135 of file unzip.cpp.

◆ UNZIP_CD_OFF_CRC32

#define UNZIP_CD_OFF_CRC32   12

Definition at line 136 of file unzip.cpp.

◆ UNZIP_CD_OFF_CSIZE

#define UNZIP_CD_OFF_CSIZE   16

Definition at line 137 of file unzip.cpp.

◆ UNZIP_CD_OFF_USIZE

#define UNZIP_CD_OFF_USIZE   20

Definition at line 138 of file unzip.cpp.

◆ UNZIP_CD_OFF_NAMELEN

#define UNZIP_CD_OFF_NAMELEN   24

Definition at line 139 of file unzip.cpp.

◆ UNZIP_CD_OFF_XLEN

#define UNZIP_CD_OFF_XLEN   26

Definition at line 140 of file unzip.cpp.

◆ UNZIP_CD_OFF_COMMLEN

#define UNZIP_CD_OFF_COMMLEN   28

Definition at line 141 of file unzip.cpp.

◆ UNZIP_CD_OFF_LHOFFSET

#define UNZIP_CD_OFF_LHOFFSET   38

Definition at line 142 of file unzip.cpp.

◆ UNZIP_LH_OFF_VERSION

#define UNZIP_LH_OFF_VERSION   0

Definition at line 145 of file unzip.cpp.

◆ UNZIP_LH_OFF_GPFLAG

#define UNZIP_LH_OFF_GPFLAG   2

Definition at line 146 of file unzip.cpp.

◆ UNZIP_LH_OFF_CMETHOD

#define UNZIP_LH_OFF_CMETHOD   4

Definition at line 147 of file unzip.cpp.

◆ UNZIP_LH_OFF_MODT

#define UNZIP_LH_OFF_MODT   6

Definition at line 148 of file unzip.cpp.

◆ UNZIP_LH_OFF_MODD

#define UNZIP_LH_OFF_MODD   8

Definition at line 149 of file unzip.cpp.

◆ UNZIP_LH_OFF_CRC32

#define UNZIP_LH_OFF_CRC32   10

Definition at line 150 of file unzip.cpp.

◆ UNZIP_LH_OFF_CSIZE

#define UNZIP_LH_OFF_CSIZE   14

Definition at line 151 of file unzip.cpp.

◆ UNZIP_LH_OFF_USIZE

#define UNZIP_LH_OFF_USIZE   18

Definition at line 152 of file unzip.cpp.

◆ UNZIP_LH_OFF_NAMELEN

#define UNZIP_LH_OFF_NAMELEN   22

Definition at line 153 of file unzip.cpp.

◆ UNZIP_LH_OFF_XLEN

#define UNZIP_LH_OFF_XLEN   24

Definition at line 154 of file unzip.cpp.

◆ UNZIP_DD_OFF_CRC32

#define UNZIP_DD_OFF_CRC32   0

Definition at line 157 of file unzip.cpp.

◆ UNZIP_DD_OFF_CSIZE

#define UNZIP_DD_OFF_CSIZE   4

Definition at line 158 of file unzip.cpp.

◆ UNZIP_DD_OFF_USIZE

#define UNZIP_DD_OFF_USIZE   8

Definition at line 159 of file unzip.cpp.

◆ UNZIP_EOCD_OFF_ENTRIES

#define UNZIP_EOCD_OFF_ENTRIES   6

Definition at line 162 of file unzip.cpp.

◆ UNZIP_EOCD_OFF_CDOFF

#define UNZIP_EOCD_OFF_CDOFF   12

Definition at line 163 of file unzip.cpp.

◆ UNZIP_EOCD_OFF_COMMLEN

#define UNZIP_EOCD_OFF_COMMLEN   16

Definition at line 164 of file unzip.cpp.

◆ UNZIP_VERSION

#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 172 of file unzip.cpp.

◆ UNZIP_VERSION_STRICT

#define UNZIP_VERSION_STRICT   0x14

Full compatibility granted until this version.

Definition at line 174 of file unzip.cpp.

◆ CRC32

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

CRC32 routine.

Definition at line 177 of file unzip.cpp.

◆ UNZIP_CHECK_FOR_VALID_DATA

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

Checks if some file has been already extracted.

Definition at line 180 of file unzip.cpp.