sg_gzifstream Class Reference

An envelope class for gzifstream. More...

#include <sgstream.hxx>

Inheritance diagram for sg_gzifstream:

gzifstream_base List of all members.

Public Member Functions

 sg_gzifstream ()
 Default constructor.
 sg_gzifstream (const string &name, ios_openmode io_mode=ios_in|ios_binary)
 Constructor that attempt to open a file with and without ".gz" extension.
 sg_gzifstream (int fd, ios_openmode io_mode=ios_in|ios_binary)
 Constructor that attaches itself to an existing file descriptor.
void open (const string &name, ios_openmode io_mode=ios_in|ios_binary)
 Attempt to open a file with and without ".gz" extension.
void attach (int fd, ios_openmode io_mode=ios_in|ios_binary)
 Attach to an existing file descriptor.
void close ()
 Close the stream.
bool is_open ()
 
Returns:
true if the file is successfully opened, false otherwise.


Related Functions

(Note that these are not member functions.)

istream & skipeol (istream &in)
 An istream manipulator that skips to end of line.
istream & skipws (istream &in)
 An istream manipulator that skips over white space.
istream & skipcomment (istream &in)
 An istream manipulator that skips comments and white space.

Detailed Description

An envelope class for gzifstream.

Definition at line 55 of file sgstream.hxx.


Constructor & Destructor Documentation

sg_gzifstream::sg_gzifstream ( const string &  name,
ios_openmode  io_mode = ios_in|ios_binary 
)

Constructor that attempt to open a file with and without ".gz" extension.

Parameters:
name name of file
io_mode file open mode(s) "or'd" together

Definition at line 45 of file sgstream.cxx.

References open().

sg_gzifstream::sg_gzifstream ( int  fd,
ios_openmode  io_mode = ios_in|ios_binary 
)

Constructor that attaches itself to an existing file descriptor.

Parameters:
fd file descriptor
io_mode file open mode(s) "or'd" together

Definition at line 55 of file sgstream.cxx.

References gzfilebuf::attach(), and gzifstream_base::gzbuf.


Member Function Documentation

void sg_gzifstream::open ( const string &  name,
ios_openmode  io_mode = ios_in|ios_binary 
)

Attempt to open a file with and without ".gz" extension.

Parameters:
name name of file
io_mode file open mode(s) "or'd" together

Definition at line 70 of file sgstream.cxx.

References gzifstream_base::gzbuf, gzfilebuf::is_open(), and gzfilebuf::open().

Referenced by sg_gzifstream().

void sg_gzifstream::attach ( int  fd,
ios_openmode  io_mode = ios_in|ios_binary 
)

Attach to an existing file descriptor.

Parameters:
fd file descriptor
io_mode file open mode(s) "or'd" together

Definition at line 94 of file sgstream.cxx.

References gzfilebuf::attach(), and gzifstream_base::gzbuf.


Friends And Related Function Documentation

istream & skipeol ( istream &  in  )  [related]

An istream manipulator that skips to end of line.

Parameters:
in input stream

Definition at line 104 of file sgstream.cxx.

Referenced by skipcomment().

istream & skipws ( istream &  in  )  [related]

An istream manipulator that skips over white space.

Parameters:
in input stream

Definition at line 123 of file sgstream.cxx.

Referenced by skipcomment().

istream & skipcomment ( istream &  in  )  [related]

An istream manipulator that skips comments and white space.

Ignores comments that start with '#'.

Parameters:
in input stream

Definition at line 145 of file sgstream.cxx.


The documentation for this class was generated from the following files:
Generated on Mon Dec 17 09:30:57 2007 for SimGear by  doxygen 1.5.1