/* * Copyright (c) 2001, Robert Collins. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * A copy of the GNU General Public License can be found at * http://www.gnu.org/ * * Written by Robert Collins * */ #ifndef _COMPRESS_BZ_H_ #define _COMPRESS_BZ_H_ /* this is the parent class for all compress IO operations. * It */ class compress_bz:public compress { public: /* assumes decompression */ compress_bz (io_stream *); /* allows comp/decomp but this implementation only handles comp */ compress_bz (io_stream *, const char *); /* read data (duh!) */ virtual ssize_t read (void *buffer, size_t len); /* provide data to (double duh!) */ virtual ssize_t write (void *buffer, size_t len); /* read data without removing it from the class's internal buffer */ virtual ssize_t peek (void *buffer, size_t len); virtual long tell (); /* try guessing this one */ virtual int error (); /* Find out the next stream name - * ie for foo.tar.bz, at offset 0, next_file_name = foo.tar * for foobar that is an compress, next_file_name is the next * extractable filename. */ virtual const char *next_file_name () { return NULL; }; virtual int set_mtime (int); /* if you are still needing these hints... give up now! */ virtual ~ compress_bz (); private: compress_bz () { }; io_stream *original; int lasterr; }; #endif /* _COMPRESS_BZ_H_ */