~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to iris/xmpp-core/compress.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef COMPRESS_H
2
 
#define COMPRESS_H
3
 
 
4
 
#include <QObject>
5
 
 
6
 
#include "zlib.h"
7
 
 
8
 
class QIODevice;
9
 
 
10
 
class Compressor : public QObject
11
 
{
12
 
        Q_OBJECT
13
 
 
14
 
public:
15
 
        Compressor(QIODevice* device, int compression = Z_DEFAULT_COMPRESSION);
16
 
        ~Compressor();
17
 
 
18
 
        int write(const QByteArray&);
19
 
 
20
 
protected slots:
21
 
        void flush();
22
 
 
23
 
protected:
24
 
        int write(const QByteArray&, bool flush);
25
 
 
26
 
private:
27
 
        QIODevice* device_;
28
 
        z_stream* zlib_stream_;
29
 
        bool flushed_;
30
 
};
31
 
 
32
 
class Decompressor : public QObject
33
 
{
34
 
        Q_OBJECT
35
 
 
36
 
public:
37
 
        Decompressor(QIODevice* device);
38
 
        ~Decompressor();
39
 
 
40
 
        int write(const QByteArray&);
41
 
 
42
 
protected slots:
43
 
        void flush();
44
 
 
45
 
protected:
46
 
        int write(const QByteArray&, bool flush);
47
 
 
48
 
private:
49
 
        QIODevice* device_;
50
 
        z_stream* zlib_stream_;
51
 
        bool flushed_;
52
 
};
53
 
 
54
 
#endif