19 #ifndef PAGESPEED_KERNEL_UTIL_GZIP_INFLATER_H_
20 #define PAGESPEED_KERNEL_UTIL_GZIP_INFLATER_H_
26 typedef struct z_stream_s z_stream;
28 namespace net_instaweb {
34 enum InflateType {kGzip, kDeflate};
55 bool SetInput(
const void *in,
size_t in_size);
67 bool error()
const {
return error_; }
71 static bool Deflate(StringPiece in, InflateType format,
Writer* writer);
72 static bool Deflate(StringPiece in, InflateType format,
int compression_level,
77 static bool Inflate(StringPiece in, InflateType format,
Writer* writer);
83 friend class GzipInflaterTestPeer;
91 static bool GetWindowBitsForFormat(
92 StreamFormat format,
int* out_window_bits);
94 void SetInputInternal(
const void *in,
size_t in_size);
95 void SwitchToRawDeflateFormat();
int InflateBytes(char *buf, size_t buf_size)
bool finished() const
Has the entire input been inflated?
Definition: gzip_inflater.h:64
bool HasUnconsumedInput() const
static bool Deflate(StringPiece in, InflateType format, Writer *writer)
Interface for writing bytes to an output stream.
Definition: writer.h:29
static bool HasGzipMagicBytes(StringPiece in)
Checks whether in starts with the gzip file signature.
bool SetInput(const void *in, size_t in_size)
Definition: gzip_inflater.h:32
bool error() const
Was an error encountered during inflating?
Definition: gzip_inflater.h:67
void ShutDown()
Should be called once, after inflating is finished.
static bool Inflate(StringPiece in, InflateType format, Writer *writer)
bool Init()
Should be called once, before inflating any data.