~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

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