// GzipReader.hpp #if !defined(GZIP_READER_HPP) #define GZIP_READER_HPP #include #include #include "Reader.hpp" namespace NGBW { class GzipReader : public Reader { public: GzipReader(const char *file_name) throw(std::bad_alloc, std::runtime_error); ~GzipReader() throw() { delete[] m_inflated; ::gzclose(m_gzip_file); } bool Eof() { return m_eof; } char GetChar(); const char *GetLine(); private: enum { READ_SIZE = 8192 }; void InflateData(size_t line_begin) throw(std::bad_alloc, std::runtime_error); bool m_eof; char *m_inflated; size_t m_max_length; size_t m_inflated_length; size_t m_line_end; gzFile m_gzip_file; }; } // namespace NGBW #endif // GZIP_READER_HPP