Atlas  0.7.0
Networking protocol for the Worldforge system.
Bzip2.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU Lesser General Public License (See COPYING for details).
3 // Copyright (C) 2000 Stefanus Du Toit, Dmitry Derevyanko
4 
5 // $Id$
6 
7 #ifndef ATLAS_FILTERS_BZIP2_H
8 #define ATLAS_FILTERS_BZIP2_H
9 
10 #include <Atlas/Filter.h>
11 
12 // my version of bzlib.h does not have extern "C" in the header file,
13 // like it should
14 // dmitryd 05/08/200
15 extern "C" {
16 #include <bzlib.h>
17 }
18 
19 namespace Atlas { namespace Filters {
20 
21 class Bzip2 : public Filter
22 {
23  bz_stream incoming;
24  bz_stream outgoing;
25  char buf[4096];
26 
27  public:
28 
29  void begin() override;
30  void end() override;
31 
32  std::string encode(const std::string&) override;
33  std::string decode(const std::string&) override;
34 };
35 
36 } } // namespace Atlas::Filters
37 
38 #endif // ATLAS_FILTERS_BZIP2_H
Definition: Bridge.h:20