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++
32 # include "Include/config.h"
37 #include "Include/compiler.h"
38 #ifdef FG_HAVE_STD_INCLUDES
45 FG_USING_STD(istream);
48 #include "zfstream.hxx"
50 //-----------------------------------------------------------------------------
52 // Envelope class for gzifstream.
54 class fg_gzifstream : private gzifstream_base, public istream
60 // Attempt to open a file with and without ".gz" extension.
61 fg_gzifstream( const string& name,
62 ios_openmode io_mode = ios_in | ios_binary );
65 fg_gzifstream( int fd, ios_openmode io_mode = ios_in|ios_binary );
67 // Attempt to open a file with and without ".gz" extension.
68 void open( const string& name,
69 ios_openmode io_mode = ios_in|ios_binary );
71 void attach( int fd, ios_openmode io_mode = ios_in|ios_binary );
73 void close() { gzbuf.close(); }
77 fg_gzifstream( const fg_gzifstream& );
78 void operator= ( const fg_gzifstream& );
81 // istream manipulator that skips to end of line.
82 istream& skipeol( istream& in );
84 // istream manipulator that skips over white space.
85 istream& skipws( istream& in );
87 // istream manipulator that skips comments and white space.
88 // A comment starts with '#'.
89 istream& skipcomment( istream& in );
92 #endif /* _FGSTREAM_HXX */
95 // Revision 1.6 1999/01/19 20:41:46 curt
96 // Portability updates contributed by Bernie Bright.
98 // Revision 1.5 1998/11/06 14:05:13 curt
99 // More portability improvements by Bernie Bright.
101 // Revision 1.4 1998/10/16 00:50:56 curt
102 // Remove leading _ from a couple defines.
104 // Revision 1.3 1998/10/13 00:10:06 curt
105 // More portability changes to help with windoze compilation problems.
107 // Revision 1.2 1998/09/24 15:22:18 curt
108 // Additional enhancements.
110 // Revision 1.1 1998/09/01 19:06:29 curt