gloox  1.0.9
compressionzlib.h
1 /*
2  Copyright (c) 2005-2013 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 #include "config.h"
21 
22 #ifdef HAVE_ZLIB
23 
24 #include <zlib.h>
25 
26 #include <string>
27 
28 namespace gloox
29 {
36  class GLOOX_API CompressionZlib : public CompressionBase
37  {
38  public:
44 
48  virtual ~CompressionZlib();
49 
50  // reimplemented from CompressionBase
51  virtual bool init();
52 
53  // reimplemented from CompressionBase
54  virtual void compress( const std::string& data );
55 
56  // reimplemented from CompressionBase
57  virtual void decompress( const std::string& data );
58 
59  // reimplemented from CompressionBase
60  virtual void cleanup();
61 
62  private:
63  z_stream m_zinflate;
64  z_stream m_zdeflate;
65 
66  util::Mutex m_compressMutex;
67 
68  };
69 
70 }
71 
72 #endif // HAVE_ZLIB
73 
74 #endif // COMPRESSIONZLIB_H__