2 * Copyright (c) 2001, Robert Collins.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef SETUP_COMPRESS_BZ_H
17 #define SETUP_COMPRESS_BZ_H
23 class compress_bz
:public compress
26 /* assumes decompression */
27 compress_bz (io_stream
*);
28 /* allows comp/decomp but this implementation only handles comp */
29 compress_bz (io_stream
*, const char *);
30 /* read data (duh!) */
31 virtual ssize_t
read (void *buffer
, size_t len
);
32 /* provide data to (double duh!) */
33 virtual ssize_t
write (const void *buffer
, size_t len
);
34 /* read data without removing it from the class's internal buffer */
35 virtual ssize_t
peek (void *buffer
, size_t len
);
36 virtual off_t
tell ();
37 virtual off_t
seek (off_t where
, io_stream_seek_t whence
);
38 /* try guessing this one */
40 /* Find out the next stream name -
41 * ie for foo.tar.bz, at offset 0, next_file_name = foo.tar
42 * for foobar that is an compress, next_file_name is the next
43 * extractable filename.
45 virtual const char *next_file_name ()
49 virtual int set_mtime (time_t);
50 /* Use seek EOF, then tell (). get_size won't do this incase you are sucking dow
52 virtual size_t get_size () {return 0;};
53 virtual time_t get_mtime ();
54 virtual mode_t
get_mode ();
55 virtual void release_original (); /* give up ownership of original io_stream */
56 /* if you are still needing these hints... give up now! */
57 virtual ~ compress_bz ();
70 void init_state(void);
73 #endif /* SETUP_COMPRESS_BZ_H */