00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef COMPRESSION_H__
00016 #define COMPRESSION_H__
00017
00018 #include "gloox.h"
00019
00020 #ifdef WIN32
00021 # include "../config.h.win"
00022 #else
00023 # include "config.h"
00024 #endif
00025
00026 #include <string>
00027
00028 #ifdef HAVE_ZLIB
00029 #include <zlib.h>
00030 #endif
00031
00032 namespace gloox
00033 {
00040 class GLOOX_API Compression
00041 {
00042 public:
00047 Compression( StreamFeature method );
00048
00052 virtual ~Compression();
00053
00059 virtual const std::string compress( const std::string& data );
00060
00066 virtual const std::string decompress( const std::string& data );
00067
00068 protected:
00069 bool m_valid;
00070 StreamFeature m_method;
00071 std::string m_inflateBuffer;
00072 int m_compCount;
00073 int m_decompCount;
00074 int m_dataOutCount;
00075 int m_dataInCount;
00076
00077 #ifdef HAVE_ZLIB
00078 z_stream m_zinflate;
00079 z_stream m_zdeflate;
00080 #endif
00081
00082 };
00083
00084 }
00085
00086 #endif // COMPRESSION_H__