gzipoutputstreambuf.h
Go to the documentation of this file.00001 #ifndef GZIPOUTPUTSTREAMBUF_H
00002 #define GZIPOUTPUTSTREAMBUF_H
00003 
00004 #include "zipios-config.h"
00005 
00006 #include <vector>
00007 
00008 #include <zlib.h>
00009 
00010 #include "deflateoutputstreambuf.h"
00011 
00012 namespace zipios {
00013 
00015 class BaseExport GZIPOutputStreambuf : public DeflateOutputStreambuf {
00016 public:
00017 
00023   explicit GZIPOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
00024 
00025   void setFilename( const string &filename );
00026   void setComment( const string &comment );
00027 
00029   void close() ;
00030 
00032   void finish() ;
00033 
00035   virtual ~GZIPOutputStreambuf() ;
00036 
00037 protected:
00038   virtual int overflow( int c = EOF ) ;
00039   virtual int sync() ;
00040 
00041 private:
00042   void writeHeader();
00043   void writeTrailer();
00044   void writeInt(uint32 i);
00045   
00046   std::string _filename;
00047   std::string _comment;
00048   bool _open ;
00049 };
00050 
00051 
00052 } 
00053 
00054 
00055 
00056 #endif
00057 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079