From: Christian P. <cp...@us...> - 2005-01-07 13:43:09
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5188/include/pclasses/IO Added Files: BZip2IOFilter.h Log Message: Added BZip2Filter.[h|cpp] --- NEW FILE: BZip2IOFilter.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_BZip2IOFilter_h #define P_IO_BZip2IOFilter_h #include <pclasses/IO/IOFilter.h> #include <pclasses/IO/BZip2.h> namespace P { namespace IO { //! BZip2 I/O Filter /*! bzlib2 stream based I/O Filter */ class BZip2IOFilter: public IOFilter { public: BZip2IOFilter(); ~BZip2IOFilter(); IOFilter* create(); void sync(bool close); bool isSeekable(); bool eof() const throw(); 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(); BZip2OutputStream* _strmOut; BZip2InputStream* _strmIn; }; } // !namespace IO } // !namespace P #endif |