gloox  0.9.9.12
compressionzlib.h
1 /*
2  Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef COMPRESSIONZLIB_H__
15 #define COMPRESSIONZLIB_H__
16 
17 #include "compressionbase.h"
18 #include "mutex.h"
19 
20 #ifdef _WIN32
21 # include "../config.h.win"
22 #elif defined( _WIN32_WCE )
23 # include "../config.h.win"
24 #else
25 # include "config.h"
26 #endif
27 
28 #ifdef HAVE_ZLIB
29 
30 #include <zlib.h>
31 
32 #include <string>
33 
34 namespace gloox
35 {
42  class GLOOX_API CompressionZlib : public CompressionBase
43  {
44  public:
50 
54  virtual ~CompressionZlib();
55 
56  // reimplemented from CompressionBase
57  virtual void compress( const std::string& data );
58 
59  // reimplemented from CompressionBase
60  virtual void decompress( const std::string& data );
61 
62  private:
63  z_stream m_zinflate;
64  z_stream m_zdeflate;
65 
66  Mutex m_compressMutex;
67 
68  };
69 
70 }
71 
72 #endif // HAVE_ZLIB
73 
74 #endif // COMPRESSIONZLIB_H__