initial commit
This commit is contained in:
commit
9d20827c46
2469 changed files with 470994 additions and 0 deletions
54
iris-legacy/iris/xmpp-core/compress.h
Normal file
54
iris-legacy/iris/xmpp-core/compress.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef COMPRESS_H
|
||||
#define COMPRESS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
class QIODevice;
|
||||
|
||||
class Compressor : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Compressor(QIODevice* device, int compression = Z_DEFAULT_COMPRESSION);
|
||||
~Compressor();
|
||||
|
||||
int write(const QByteArray&);
|
||||
|
||||
protected slots:
|
||||
void flush();
|
||||
|
||||
protected:
|
||||
int write(const QByteArray&, bool flush);
|
||||
|
||||
private:
|
||||
QIODevice* device_;
|
||||
z_stream* zlib_stream_;
|
||||
bool flushed_;
|
||||
};
|
||||
|
||||
class Decompressor : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Decompressor(QIODevice* device);
|
||||
~Decompressor();
|
||||
|
||||
int write(const QByteArray&);
|
||||
|
||||
protected slots:
|
||||
void flush();
|
||||
|
||||
protected:
|
||||
int write(const QByteArray&, bool flush);
|
||||
|
||||
private:
|
||||
QIODevice* device_;
|
||||
z_stream* zlib_stream_;
|
||||
bool flushed_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in a new issue