compression.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
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__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1