Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

Classes | Macros | Typedefs | Enumerations | Functions
Zip Code Internals
Zip Code

## Classes
class | CentralDir
class | EndOfCentralDir
class | Compressor
class | ExtraField
class | FileHeader
class | ZipStatFilter
| Helper class for tracking CRC and uncompressed size. More...
class | ZipTempStream

## Macros
#define | ImplementCompressor(name, method)
#define | CompressorCreateReadStream(name) Stream * Compressor##name::createReadStream(const CentralDir *cdir, Stream *zipStream)
#define | CompressorCreateWriteStream(name) Stream * Compressor##name::createWriteStream(const CentralDir *cdir, Stream *zipStream)
#define | DeclareExtraField(name) name(U16 id, ExtraFieldCreateFn fnCreate) : Parent(id, fnCreate) {}
#define | ImplementExtraField(name, id) name gExtraField##name##instance(id, &createExtraField<name>);

## Typedefs
typedef ExtraField *(* | ExtraFieldCreateFn) ()

## Enumerations
enum | CDIntFlags { CDFileDirty = BIT(0), CDFileAdded = BIT(1), CDFileDeleted = BIT(2), CDFileOpen = BIT(3) }
| Internal flags used by the zip code when writing zips. More...
enum | CompressionMethod { Stored = 0, Shrunk = 1, ReducedL1 = 2, ReducedL2 = 3, ReducedL3 = 4, ReducedL4 = 5, Imploded = 6, ReservedTokenized = 7, Deflated = 8, EnhDefalted = 9, DateCompression = 10, ReservedPKWARE = 11, BZip2 = 12, PPMd = 98, AESEncrypted = 99 }
enum | FileFlags { Encrypted = BIT(0), Implode8KDictionary = BIT(1), Implode3ShannonFanoTrees = BIT(2), DeflateTypeMask = BIT(1) | BIT(2), FileInfoInDirectory = BIT(3), ReservedEnhDeflate = BIT(4), PatchData = BIT(5), StrongEncryption = BIT(6), UnusedReserved1 = BIT(7), UnusedReserved2 = BIT(8), UnusedReserved3 = BIT(9), UnusedReserved4 = BIT(10), UnusedReserved5 = BIT(11), ReservedPKWARE1 = BIT(12), EncryptedDirectory = BIT(13), ReservedPKWARE2 = BIT(14), ReservedPKWARE3 = BIT(15) }

## Functions
template<class T >
ExtraField * | createExtraField ()

## Detailed Description

The zip code internals are mostly undocumented, but should be fairly obvious to anyone who is familiar with the zip file format.

## Macro Definition Documentation

#define CompressorCreateReadStream | ( |  | name | ) | Stream * Compressor##name::createReadStream(const CentralDir *cdir, Stream *zipStream)

#define CompressorCreateWriteStream | ( |  | name | ) | Stream * Compressor##name::createWriteStream(const CentralDir *cdir, Stream *zipStream)

#define DeclareExtraField | ( |  | name | ) | name(U16 id, ExtraFieldCreateFn fnCreate) : Parent(id, fnCreate) {}

#define ImplementCompressor | ( |  | name,
|  |  | method
| ) |  |

Value:
class Compressor##name : public Compressor \
{ \
public: \
Compressor##name(S32 m, const char *n) : Compressor(m, n) {} \
virtual Stream *createReadStream(const CentralDir *cdir, Stream *zipStream); \
virtual Stream *createWriteStream(const CentralDir *cdir, Stream *zipStream); \
}; \
Compressor##name gCompressor##name##instance(method, #name);
Stream
Base stream class for streaming data across a specific media.
Definition: stream.h:68

#define ImplementExtraField | ( |  | name,
|  |  | id
| ) |  | name gExtraField##name##instance(id, &createExtraField<name>);

## Typedef Documentation

typedef ExtraField*(* ExtraFieldCreateFn) ()

## Enumeration Type Documentation

enum CDIntFlags

Internal flags used by the zip code when writing zips.

Enumerator
CDFileDirty |
CDFileAdded |
CDFileDeleted |
CDFileOpen |

enum CompressionMethod

Enumerator
Stored |
Shrunk |
ReducedL1 |
ReducedL2 |
ReducedL3 |
ReducedL4 |
Imploded |
ReservedTokenized |
Deflated |
EnhDefalted |
DateCompression |
ReservedPKWARE |
BZip2 |
PPMd |
AESEncrypted |

enum FileFlags

Enumerator
Encrypted |
Implode8KDictionary |
Implode3ShannonFanoTrees |
DeflateTypeMask |
FileInfoInDirectory |
ReservedEnhDeflate |
PatchData |
StrongEncryption |
UnusedReserved1 |
UnusedReserved2 |
UnusedReserved3 |
UnusedReserved4 |
UnusedReserved5 |
ReservedPKWARE1 |
EncryptedDirectory |
ReservedPKWARE2 |
ReservedPKWARE3 |

## Function Documentation

ExtraField* Zip::createExtraField | ( |  | ) |