compressionzlib.h
/*
Copyright (c) 2005-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef COMPRESSIONZLIB_H__
#define COMPRESSIONZLIB_H__
#include "compressionbase.h"
#include "mutex.h"
#include "config.h"
#ifdef HAVE_ZLIB
#include <zlib.h>
#include <string>
namespace gloox
{
class GLOOX_API CompressionZlib : public CompressionBase
{
public:
CompressionZlib( CompressionDataHandler* cdh );
virtual ~CompressionZlib();
// reimplemented from CompressionBase
virtual bool init();
// reimplemented from CompressionBase
virtual void compress( const std::string& data );
// reimplemented from CompressionBase
virtual void decompress( const std::string& data );
// reimplemented from CompressionBase
virtual void cleanup();
private:
z_stream m_zinflate;
z_stream m_zdeflate;
util::Mutex m_compressMutex;
};
}
#endif // HAVE_ZLIB
#endif // COMPRESSIONZLIB_H__
gloox::CompressionBase::CompressionBase
CompressionBase(CompressionDataHandler *cdh)
Definition compressionbase.h:42
gloox::CompressionDataHandler
An abstract base class used to receive de/compressed data from a CompressionBase-derived object.
Definition compressiondatahandler.h:35
gloox::CompressionZlib::CompressionZlib
CompressionZlib(CompressionDataHandler *cdh)
Definition compressionzlib.cpp:22
gloox::CompressionZlib::compress
virtual void compress(const std::string &data)
Definition compressionzlib.cpp:57
gloox::CompressionZlib::cleanup
virtual void cleanup()
Definition compressionzlib.cpp:120
gloox::CompressionZlib::decompress
virtual void decompress(const std::string &data)
Definition compressionzlib.cpp:90
gloox::CompressionZlib::init
virtual bool init()
Definition compressionzlib.cpp:27
gloox::util::Mutex
A simple implementation of mutex as a wrapper around a pthread mutex or a win32 critical section.
Definition mutex.h:34
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28