summaryrefslogtreecommitdiff
path: root/gzip.h
diff options
context:
space:
mode:
Diffstat (limited to 'gzip.h')
-rw-r--r--gzip.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gzip.h b/gzip.h
index 271ff500..0c3f53df 100644
--- a/gzip.h
+++ b/gzip.h
@@ -27,13 +27,17 @@ public:
//! if a file has both compressible and uncompressible parts, it may fail to compress
//! some of the compressible parts.
Gzip(BufferedTransformation *attachment=NULLPTR, unsigned int deflateLevel=DEFAULT_DEFLATE_LEVEL, unsigned int log2WindowSize=DEFAULT_LOG2_WINDOW_SIZE, bool detectUncompressible=true)
- : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0) {}
+ : Deflator(attachment, deflateLevel, log2WindowSize, detectUncompressible), m_totalLen(0) { }
+
//! \brief Construct a Gzip compressor
//! \param parameters a set of NameValuePairs to initialize this object
//! \param attachment an attached transformation
//! \details Possible parameter names: Log2WindowSize, DeflateLevel, DetectUncompressible
Gzip(const NameValuePairs &parameters, BufferedTransformation *attachment=NULLPTR)
- : Deflator(parameters, attachment), m_totalLen(0) {}
+ : Deflator(parameters, attachment), m_totalLen(0)
+ {
+ IsolatedInitialize(parameters);
+ }
//! \param filetime the filetime to set in the header. The application is responsible for setting it.
void SetFiletime(word32 filetime) { m_filetime = filetime; }
@@ -52,6 +56,8 @@ public:
//! is thrown. If throwOnEncodingError is false then the comment is not checked.
void SetComment(const std::string& comment, bool throwOnEncodingError = false);
+ void IsolatedInitialize(const NameValuePairs &parameters);
+
protected:
enum {MAGIC1=0x1f, MAGIC2=0x8b, // flags for the header
DEFLATED=8, FAST=4, SLOW=2};