gloox 1.0

compressionbase.h

00001 /*
00002   Copyright (c) 2005-2009 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 
00015 #ifndef COMPRESSIONBASE_H__
00016 #define COMPRESSIONBASE_H__
00017 
00018 #include "gloox.h"
00019 #include "compressiondatahandler.h"
00020 
00021 #include <string>
00022 
00023 namespace gloox
00024 {
00025 
00034   class GLOOX_API CompressionBase
00035   {
00036     public:
00042       CompressionBase( CompressionDataHandler* cdh ) : m_handler( cdh ), m_valid( false ) {}
00043 
00047       virtual ~CompressionBase() {}
00048 
00054       virtual bool init() = 0;
00055 
00060       virtual void compress( const std::string& data ) = 0;
00061 
00066       virtual void decompress( const std::string& data ) = 0;
00067 
00072       virtual void cleanup() = 0;
00073 
00074     protected:
00076       CompressionDataHandler* m_handler;
00077 
00079       bool m_valid;
00080 
00081   };
00082 
00083 }
00084 
00085 #endif // COMPRESSIONBASE_H__