version 3.0
This commit is contained in:
commit
d837490606
209 changed files with 19662 additions and 0 deletions
48
zlib/zlib_filter.h
Normal file
48
zlib/zlib_filter.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// File: zlib_filter.h //
|
||||
// Description: data filters for zlib inflate/deflate streams //
|
||||
// Project: WANProxy XTech //
|
||||
// Author: Andreu Vidal Bramfeld-Software //
|
||||
// Last modified: 2015-04-01 //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef ZLIB_DEFLATE_FILTER_H
|
||||
#define ZLIB_DEFLATE_FILTER_H
|
||||
|
||||
#include <common/filter.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#define DEFLATE_CHUNK_SIZE 0x10000
|
||||
#define INFLATE_CHUNK_SIZE 0x10000
|
||||
|
||||
class DeflateFilter : public BufferedFilter
|
||||
{
|
||||
private:
|
||||
z_stream stream_;
|
||||
uint8_t outbuf[DEFLATE_CHUNK_SIZE];
|
||||
|
||||
public:
|
||||
DeflateFilter (int level = 0);
|
||||
virtual ~DeflateFilter ();
|
||||
|
||||
virtual bool consume (Buffer& buf);
|
||||
virtual void flush (int flg);
|
||||
};
|
||||
|
||||
class InflateFilter : public BufferedFilter
|
||||
{
|
||||
private:
|
||||
z_stream stream_;
|
||||
uint8_t outbuf[INFLATE_CHUNK_SIZE];
|
||||
|
||||
public:
|
||||
InflateFilter ();
|
||||
~InflateFilter ();
|
||||
|
||||
virtual bool consume (Buffer& buf);
|
||||
virtual void flush (int flg);
|
||||
};
|
||||
|
||||
#endif /* !ZLIB_DEFLATE_FILTER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue