libutil++  1.9.3
 All Classes Functions Variables
Compress.h
1 /*
2 ** libutil++
3 ** $Id: Compress.h 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 #ifndef __libutilxx__sella__util__Compress_H__
10 #define __libutilxx__sella__util__Compress_H__
11 
12 #include "../../common.h"
13 
14 #include <list>
15 #include <string>
16 
17 #define SELLA_UTIL_COMPRESS_LEVEL_DEF 9
18 
19 namespace sella {
20  namespace util {
21  class Compress;
22  }
23 }
24 
26  public:
27  Compress(int level = SELLA_UTIL_COMPRESS_LEVEL_DEF);
28  Compress(const Compress &other);
29  virtual ~Compress();
30  Compress& operator=(const Compress &other) throw ();
31 
32  void clear(void);
33 
34  void setLevel(int level = SELLA_UTIL_COMPRESS_LEVEL_DEF);
35  int getLevel(void) const;
36 
37  bool deflate(const void *uncompressed, size_t len);
38  bool inflate(const void *compressed, size_t len);
39 
40  const void* getCompressed(void) const;
41  const void* getUncompressed(void) const;
42 
43  size_t getCompressedLen(void) const;
44  size_t getUncompressedLen(void) const;
45 
46  protected:
47  private:
48  int level;
49  void *c;
50  void *un;
51 
52  size_t clen;
53  size_t unlen;
54 };
55 
56 #endif
57 
58 /*
59 ** vim: noet ts=3 sw=3
60 */