Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

wvgzip.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Gzip encoder/decoder based on zlib.
00006  */
00007 #ifndef __WVGZIP_H
00008 #define __WVGZIP_H
00009 
00010 #include "wvencoder.h"
00011 #include "wvencoderstream.h"
00012 
00013 struct z_stream_s;
00014 
00035 class WvGzipEncoder : public WvEncoder
00036 {
00037 public:
00038     enum Mode {
00039         Deflate, 
00040         Inflate  
00041     };
00042     
00048     WvGzipEncoder(Mode mode);
00049     virtual ~WvGzipEncoder();
00050     
00051 protected:
00052     virtual bool _encode(WvBuf &inbuf, WvBuf &outbuf, bool flush);
00053     virtual bool _finish(WvBuf &outbuf);
00054     virtual bool _reset();
00055 
00056 private:
00057     struct z_stream_s *zstr;
00058     WvInPlaceBuf tmpbuf;
00059     Mode mode;
00060 
00061     void init();
00062     void close();
00063     void prepare(WvBuf *inbuf);
00064     bool process(WvBuf &outbuf, bool flush, bool finish);
00065 };
00066 
00067 
00068 #endif // __WVGZIP_H

Generated on Sun Jul 10 15:30:56 2005 for WvStreams by  doxygen 1.4.0