aboutsummaryrefslogtreecommitdiff
path: root/src/stable/deflate.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/stable/deflate.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/stable/deflate.h b/src/stable/deflate.h
index 114b173..2ccd53f 100644
--- a/src/stable/deflate.h
+++ b/src/stable/deflate.h
@@ -14,53 +14,53 @@
14 14
15namespace Bu 15namespace Bu
16{ 16{
17 /** 17 /**
18 * Provides Deflate (LZ77) support via zlib. This provides zlib, raw, and 18 * Provides Deflate (LZ77) support via zlib. This provides zlib, raw, and
19 * gzip stream types. By default it will autodetect the input type and 19 * gzip stream types. By default it will autodetect the input type and
20 * encode into a raw deflate stream. 20 * encode into a raw deflate stream.
21 * 21 *
22 *@ingroup Streams 22 *@ingroup Streams
23 *@ingroup Compression 23 *@ingroup Compression
24 */ 24 */
25 class Deflate : public Bu::Filter 25 class Deflate : public Bu::Filter
26 { 26 {
27 public: 27 public:
28 enum Format 28 enum Format
29 { 29 {
30 Raw = 0x01, 30 Raw = 0x01,
31 Zlib = 0x02, 31 Zlib = 0x02,
32 Gzip = 0x03, 32 Gzip = 0x03,
33 AutoDetect = 0x04, 33 AutoDetect = 0x04,
34 34
35 AutoRaw = 0x04|0x01, 35 AutoRaw = 0x04|0x01,
36 AutoZlib = 0x04|0x02, 36 AutoZlib = 0x04|0x02,
37 AutoGzip = 0x04|0x03 37 AutoGzip = 0x04|0x03
38 }; 38 };
39 39
40 Deflate( Bu::Stream &rNext, int nCompression=-1, Format eFmt=AutoZlib ); 40 Deflate( Bu::Stream &rNext, int nCompression=-1, Format eFmt=AutoZlib );
41 virtual ~Deflate(); 41 virtual ~Deflate();
42 42
43 virtual void start(); 43 virtual void start();
44 virtual Bu::size stop(); 44 virtual Bu::size stop();
45 virtual Bu::size read( void *pBuf, Bu::size nBytes ); 45 virtual Bu::size read( void *pBuf, Bu::size nBytes );
46 virtual Bu::size write( const void *pBuf, Bu::size nBytes ); 46 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
47 47
48 virtual bool isOpen(); 48 virtual bool isOpen();
49 virtual bool isEos(); 49 virtual bool isEos();
50 50
51 Bu::size getCompressedSize(); 51 Bu::size getCompressedSize();
52 52
53 private: 53 private:
54 void zError( int code ); 54 void zError( int code );
55 void *prState; 55 void *prState;
56 bool bReading; 56 bool bReading;
57 int nCompression; 57 int nCompression;
58 char *pBuf; 58 char *pBuf;
59 uint32_t nBufSize; 59 uint32_t nBufSize;
60 Bu::size sTotalOut; 60 Bu::size sTotalOut;
61 Format eFmt; 61 Format eFmt;
62 bool bEos; 62 bool bEos;
63 }; 63 };
64} 64}
65 65
66#endif 66#endif