00001 #ifndef CLASSLIB_BZ_DECOMPRESSOR_H 00002 # define CLASSLIB_BZ_DECOMPRESSOR_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/zip/Decompressor.h" 00007 # include "classlib/zip/BZConstants.h" 00008 00009 namespace lat { 00010 //<<<<<< PUBLIC DEFINES >>>>>> 00011 //<<<<<< PUBLIC CONSTANTS >>>>>> 00012 //<<<<<< PUBLIC TYPES >>>>>> 00013 //<<<<<< PUBLIC VARIABLES >>>>>> 00014 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00015 //<<<<<< CLASS DECLARATIONS >>>>>> 00016 00035 class BZDecompressor : public Decompressor, public BZConstants 00036 { 00037 public: 00038 BZDecompressor (void); 00039 ~BZDecompressor (void); 00040 00041 // Global compressor state 00042 virtual void reset (void); 00043 virtual void end (void); 00044 00045 // Input management 00046 virtual bool more (void) const; 00047 virtual void input (const void *buffer, IOSize length); 00048 virtual IOSize rest (void) const; 00049 00050 // Decompression 00051 virtual bool finished (void) const; 00052 virtual IOSize decompress (void *into, IOSize length); 00053 00054 // Statistics 00055 virtual unsigned checksum (void) const; 00056 virtual IOOffset in (void) const; 00057 virtual IOOffset out (void) const; 00058 00059 private: 00060 struct Stream; 00061 Stream *m_stream; //< BZLIB state 00062 unsigned m_checksum; //< CRC-32 checksum of input 00063 int m_state; //< BZLIB state from last compression 00064 00065 // undefined, no semantics 00066 BZDecompressor (const BZDecompressor &other); 00067 BZDecompressor &operator= (const BZDecompressor &other); 00068 }; 00069 00070 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00071 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00072 00073 } // namespace lat 00074 #endif // CLASSLIB_BZ_DECOMPRESSOR_H