compressionzlib.h

00001 /*
00002   Copyright (c) 2005-2009 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 #ifndef COMPRESSIONZLIB_H__
00015 #define COMPRESSIONZLIB_H__
00016 
00017 #include "compressionbase.h"
00018 #include "mutex.h"
00019 
00020 #include "config.h"
00021 
00022 #ifdef HAVE_ZLIB
00023 
00024 #include <zlib.h>
00025 
00026 #include <string>
00027 
00028 namespace gloox
00029 {
00036   class GLOOX_API CompressionZlib : public CompressionBase
00037   {
00038     public:
00043       CompressionZlib( CompressionDataHandler* cdh );
00044 
00048       virtual ~CompressionZlib();
00049 
00050       // reimplemented from CompressionBase
00051       virtual bool init();
00052 
00053       // reimplemented from CompressionBase
00054       virtual void compress( const std::string& data );
00055 
00056       // reimplemented from CompressionBase
00057       virtual void decompress( const std::string& data );
00058 
00059       // reimplemented from CompressionBase
00060       virtual void cleanup();
00061 
00062     private:
00063       z_stream m_zinflate;
00064       z_stream m_zdeflate;
00065 
00066       util::Mutex m_compressMutex;
00067 
00068   };
00069 
00070 }
00071 
00072 #endif // HAVE_ZLIB
00073 
00074 #endif // COMPRESSIONZLIB_H__
Generated on Tue Jun 8 23:37:53 2010 for gloox by  doxygen 1.6.3