29 :
Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0), m_filetime(0) { }
36 :
Deflator(parameters, attachment), m_totalLen(0), m_filetime(0)
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;
86 class HeaderErr :
public Err {
public: HeaderErr() : Err(
INVALID_DATA_FORMAT,
"Gunzip: header decoding error") {}};
88 class TailErr :
public Err {
public: TailErr() : Err(
INVALID_DATA_FORMAT,
"Gunzip: tail too short") {}};
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.
@ DEFAULT_LOG2_WINDOW_SIZE
Default window size (15)
@ DEFAULT_DEFLATE_LEVEL
Default deflation level, compromise between speed (6)
Deflator(BufferedTransformation *attachment=NULL, int deflateLevel=DEFAULT_DEFLATE_LEVEL, int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true)
Construct a Deflator compressor.
@ 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.
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(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)
void IsolatedInitialize(const NameValuePairs ¶meters)
Initialize or reinitialize this object, without signal propagation.
Gzip(const NameValuePairs ¶meters, BufferedTransformation *attachment=NULL)
Construct a Gzip compressor.
Inflator(BufferedTransformation *attachment=NULL, bool repeat=false, int autoSignalPropagation=-1)
RFC 1951 Decompressor.
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)