Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11889/include/pclasses/IO
Added Files:
ZLibIOFilter.h
Log Message:
Added ZLibIOFilter as promised to Stephan ;-)
--- NEW FILE: ZLibIOFilter.h ---
/***************************************************************************
* Copyright (C) 2004 by Christian Prochnow *
* cp...@se... *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef P_IO_ZLibIOFilter_h
#define P_IO_ZLibIOFilter_h
#include <pclasses/IO/IOFilter.h>
#include <pclasses/IO/ZLib.h>
namespace P {
namespace IO {
//! ZLib I/O Filter
/*!
ZLib stream based I/O Filter. This is not a gzip filter!
*/
class ZLibIOFilter: public IOFilter {
public:
ZLibIOFilter();
~ZLibIOFilter();
IOFilter* create();
void sync(bool close);
bool isSeekable();
size_t read(char* buffer, size_t count) throw(IOError);
size_t write(const char* buffer, size_t count)
throw(IO::IOError);
size_t peek(char* buffer, size_t count) throw(IOError);
offset_t seek(offset_t offset, IO::IODevice::SeekMode mode) throw(IOError);
offset_t size() const throw(IOError);
private:
void flushAvailBytes();
ZLibOutputStream* _strmOut;
ZLibInputStream* _strmIn;
};
} // !namespace IO
} // !namespace P
#endif
|