341
|
1 // Transparently decompresses gzip files, as well as uncompressed
|
|
2
|
|
3 // File_Extractor 0.4.0
|
|
4 #ifndef GZIP_READER_H
|
|
5 #define GZIP_READER_H
|
|
6
|
|
7 #include "Data_Reader.h"
|
|
8 #include "Zlib_Inflater.h"
|
|
9
|
|
10 class Gzip_Reader : public Data_Reader {
|
|
11 public:
|
|
12 error_t open( File_Reader* );
|
|
13 void close();
|
|
14
|
|
15 public:
|
|
16 Gzip_Reader();
|
|
17 ~Gzip_Reader();
|
|
18 long remain() const;
|
|
19 error_t read( void*, long );
|
|
20 long read_avail( void*, long );
|
|
21 private:
|
|
22 File_Reader* in;
|
|
23 long tell_;
|
|
24 long size_;
|
|
25 Zlib_Inflater inflater;
|
|
26
|
|
27 error_t calc_size();
|
|
28 blargg_err_t read_( void* out, long* count );
|
|
29 };
|
|
30
|
|
31 #endif
|