00001 // ===================================================================== 00002 // $Id: TDataDeflation.hh,v 1.2 2003/07/30 16:21:20 goiwai Exp $ 00003 // $Name: CLDAQ-1-08-00 $ 00004 // 00005 // $Log: TDataDeflation.hh,v $ 00006 // Revision 1.2 2003/07/30 16:21:20 goiwai 00007 // ファイルにコミットログをつけることにしました. 00008 // 00009 // ===================================================================== 00010 #ifndef __TDATADEFLATION_HH 00011 #define __TDATADEFLATION_HH 00012 #ifdef __CLDAQ_ZLIB_USE 00013 00014 #include "Tglobals.h" 00015 00016 // Z_NO_COMPRESSION 0 00017 // Z_BEST_SPEED 1 00018 // Z_BEST_COMPRESSION 9 00019 // Z_DEFAULT_COMPRESSION (-1) 00020 00021 class TDataDeflation 00022 { 00023 00024 private: 00025 enum { tDefaultBufferSize = 1024 * 1024 }; 00026 00027 private: 00028 Tzstream theDeflationStream; 00029 Tint theCompressionLevel; 00030 Tint theStatus; 00031 Tbyte* theOutputBuffer; 00032 Tint theSizeOfOutputBuffer; 00033 Tvoid* theDeflatedData; 00034 Tint theSizeOfDeflatedData; 00035 00036 public: 00037 TDataDeflation( Tint bufsize = tDefaultBufferSize, Tint level = Z_DEFAULT_COMPRESSION ); 00038 TDataDeflation( const TDataDeflation& right ); 00039 ~TDataDeflation(); 00040 00041 public: 00042 const TDataDeflation& operator=( const TDataDeflation& right ); 00043 00044 public: 00045 Tvoid Compress( Tvoid* input, Tint nbyte, Tbool islast = Tfalse ); 00046 00047 public: 00048 const Tzstream& GetDeflationStream() const; 00049 Tzstream& GetDeflationStream(); 00050 Tint GetCompressionLevel() const; 00051 Tint GetStatus() const; 00052 Tint GetSizeOfOutputBuffer() const; 00053 Tvoid* GetDeflatedData() const; 00054 Tint GetSizeOfDeflatedData() const; 00055 Tvoid SetCompressionLevel( Tint level ); 00056 Tvoid SetOutputBuffer( Tint bufsize ); 00057 00058 }; 00059 00060 inline const Tzstream& TDataDeflation::GetDeflationStream() const 00061 { 00062 return( theDeflationStream ); 00063 } 00064 00065 inline Tzstream& TDataDeflation::GetDeflationStream() 00066 { 00067 return( theDeflationStream ); 00068 } 00069 00070 inline Tint TDataDeflation::GetCompressionLevel() const 00071 { 00072 return( theCompressionLevel ); 00073 } 00074 00075 inline Tint TDataDeflation::GetStatus() const 00076 { 00077 return( theStatus ); 00078 } 00079 00080 inline Tint TDataDeflation::GetSizeOfOutputBuffer() const 00081 { 00082 return( theSizeOfOutputBuffer ); 00083 } 00084 00085 inline Tvoid* TDataDeflation::GetDeflatedData() const 00086 { 00087 return( theDeflatedData ); 00088 } 00089 00090 inline Tint TDataDeflation::GetSizeOfDeflatedData() const 00091 { 00092 return( theSizeOfDeflatedData ); 00093 } 00094 00095 #endif 00096 #endif