1 // zlib input file stream wrapper.
3 // Written by Bernie Bright, 1998
5 // Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 // (Log is kept at end of this file)
28 # error This library requires C++
37 #include "Include/fg_stl_config.h"
38 _FG_USING_NAMESPACE(std);
40 #include "zfstream.hxx"
42 //-----------------------------------------------------------------------------
44 // Envelope class for gzifstream.
52 // Attempt to open a file with and without ".gz" extension.
53 fg_gzifstream( const string& name,
54 int io_mode = ios::in|ios::binary );
57 fg_gzifstream( int fd, int io_mode = ios::in|ios::binary );
59 // Attempt to open a file with and without ".gz" extension.
60 void open( const string& name,
61 int io_mode = ios::in|ios::binary );
63 // Return the underlying stream.
64 istream& stream() { return gzstream; }
66 // Check stream state.
67 bool operator ! () const { return !gzstream; }
69 // Check for end of file.
70 bool eof() const { return gzstream.eof(); }
72 // Remove whitespace from stream.
73 // Whitespace is as defined by isspace().
74 istream& eat_whitespace();
76 // Removes comments and whitespace from stream.
77 // A comment is any line starting with '#'.
78 istream& eat_comments();
80 // Read one character from stream.
81 istream& get( char& c ) { return gzstream.get(c); }
83 // Put a character back into the input buffer.
84 istream& putback( char c ) { return gzstream.putback(c); }
87 // The underlying compressed data stream.
92 fg_gzifstream( const fg_gzifstream& );
95 // istream manipulator that skips to end of line.
96 istream& skipeol( istream& in );
98 // istream manipulator that skips over white space.
99 istream& skipws( istream& in );
101 // istream manipulator that skips comments and white space.
102 // A comment starts with '#'.
103 istream& skipcomment( istream& in );
105 #endif /* _FGSTREAM_HXX */
108 // Revision 1.3 1998/10/13 00:10:06 curt
109 // More portability changes to help with windoze compilation problems.
111 // Revision 1.2 1998/09/24 15:22:18 curt
112 // Additional enhancements.
114 // Revision 1.1 1998/09/01 19:06:29 curt