28 Gzip(
BufferedTransformation *attachment=NULLPTR,
unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL,
unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE,
bool detectUncompressible=
true)
29 :
Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0), m_filetime(0) { }
36 :
Deflator(parameters, attachment), m_totalLen(0), m_filetime(0)
38 IsolatedInitialize(parameters);
49 void SetFilename(
const std::string& filename,
bool throwOnEncodingError =
false);
56 void SetComment(
const std::string& comment,
bool throwOnEncodingError =
false);
61 enum {MAGIC1=0x1f, MAGIC2=0x8b,
62 DEFLATED=8, FAST=4, SLOW=2};
65 FILENAME=8, COMMENTS=16};
67 void WritePrestreamHeader();
68 void ProcessUncompressedData(
const byte *
string,
size_t length);
69 void WritePoststreamTail();
75 std::string m_filename;
76 std::string m_comment;
107 const std::string&
GetFilename(
bool throwOnEncodingError =
false)
const;
113 const std::string&
GetComment(
bool throwOnEncodingError =
false)
const;
126 CONTINUED=2, EXTRA_FIELDS=4, FILENAME=8, COMMENTS=16, ENCRYPTED=32};
128 unsigned int MaxPrestreamHeaderSize()
const {
return 1024;}
129 void ProcessPrestreamHeader();
130 void ProcessDecompressedData(
const byte *
string,
size_t length);
131 unsigned int MaxPoststreamTailSize()
const {
return 8;}
132 void ProcessPoststreamTail();
138 std::string m_filename;
139 std::string m_comment;
CRC-32 Checksum Calculation.
DEFLATE compressor (RFC 1951)
@ INVALID_DATA_FORMAT
Input data was received that did not conform to expected format.
@ DATA_INTEGRITY_CHECK_FAILED
Data integerity check, such as CRC or MAC, failed.
Exception thrown when a CRC error occurs.
Exception thrown when a length error occurs.
Exception thrown when the tail is too short.
GZIP Decompression (RFC 1952)
Gunzip(BufferedTransformation *attachment=NULL, bool repeat=false, int autoSignalPropagation=-1)
Construct a Gunzip decompressor.
word32 GetFiletime() const
const std::string & GetComment(bool throwOnEncodingError=false) const
const std::string & GetFilename(bool throwOnEncodingError=false) const
GZIP Compression (RFC 1952)
Gzip(BufferedTransformation *attachment=NULL, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true)
Construct a Gzip compressor.
void SetFiletime(word32 filetime)
Gzip(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL)
Construct a Gzip compressor.
DEFLATE decompressor (RFC 1951)
Interface for retrieving values given their names.
unsigned int word32
32-bit unsigned datatype
Classes for CRC-32 and CRC-32C checksum algorithm.
Abstract base classes that provide a uniform interface to this library.
Crypto++ library namespace.
DEFLATE compression and decompression (RFC 1951)
DEFLATE compression and decompression (RFC 1951)