WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Zlib.h
1#ifndef _WINC_ZLIB
2#define _WINC_ZLIB
3
4#include <zlib.h>
5
6#include <WXP/Buffer.h>
7
8namespace WXP {
9 class Zlib {
10 int type;
11 int setup;
12 z_stream zs;
13 int stat;
14
15 public:
16 Zlib();
17 Zlib( int rtype );
18 int init();
19 int set( unsigned char *next_in, int avail_in,
20 unsigned char *next_out, int avail_out );
21 int decomp();
22 int decomp( Buffer &in, Buffer &out );
23 int comp( int flag );
24 int finish();
25 int print();
26
27 //static void *alloc( void *opaque, unsigned int num, unsigned int size );
28 //static void free( void *opaque, void *buf );
29
31 inline int getStatus(){ return stat; };
33 inline int getAvailIn(){ return zs.avail_in; };
35 inline int getAvailOut(){ return zs.avail_out; };
37 inline int getTotalOut(){ return zs.total_out; };
39 inline bool isError(){ return stat < 0 ? true : false; };
40
41 static int const STREAM_END = Z_STREAM_END;
42 static int const NEED_DICT = Z_NEED_DICT;
43 static int const OK = Z_OK;
44 static int const FINISH = Z_FINISH;
47 enum Type {
49 DECOMP
50 };
51 };
52}
53#endif
This class creates a generic buffer for data.
Definition Buffer.h:5
This class manages zlib decompression.
Definition Zlib.h:9
static int const STREAM_END
Definition Zlib.h:41
int getStatus()
Definition Zlib.h:31
int set(unsigned char *next_in, int avail_in, unsigned char *next_out, int avail_out)
Definition Zlib.cc:59
int getAvailIn()
Definition Zlib.h:33
int comp(int flag)
Definition Zlib.cc:106
int getTotalOut()
Definition Zlib.h:37
int init()
Definition Zlib.cc:43
bool isError()
Definition Zlib.h:39
static int const OK
Definition Zlib.h:43
int decomp()
Definition Zlib.cc:71
int print()
Definition Zlib.cc:129
int getAvailOut()
Definition Zlib.h:35
static int const NEED_DICT
Definition Zlib.h:42
static int const FINISH
Definition Zlib.h:44
Type
Definition Zlib.h:47
@ DECOMP
Definition Zlib.h:49
@ COMP
Definition Zlib.h:48
Zlib()
Definition Zlib.cc:19
int finish()
Definition Zlib.cc:115
All WXP classes fall under the WXP namespace.
Definition Angle.h:4