simgear  3.5.0 [next] git://gitorious.org/fg/simgear.git
SimGear - Simulator Construction Tools
sg_gzifstream Class Reference

#include <sgstream.hxx>

Inheritance diagram for sg_gzifstream:
gzifstream_base simgear::gzContainerReader

Public Member Functions

 sg_gzifstream ()
 
 sg_gzifstream (const std::string &name, ios_openmode io_mode=ios_in|ios_binary)
 
 sg_gzifstream (int fd, ios_openmode io_mode=ios_in|ios_binary)
 
void attach (int fd, ios_openmode io_mode=ios_in|ios_binary)
 
void close ()
 
bool is_open ()
 
void open (const std::string &name, ios_openmode io_mode=ios_in|ios_binary)
 

Private Member Functions

 sg_gzifstream (const sg_gzifstream &)
 
void operator= (const sg_gzifstream &)
 

Private Attributes

gzfilebuf gzbuf
 

Related Functions

(Note that these are not member functions.)

std::istream & skipcomment (std::istream &in)
 
std::istream & skipeol (std::istream &in)
 
std::istream & skipws (std::istream &in)
 

Detailed Description

An envelope class for gzifstream.

Definition at line 46 of file sgstream.hxx.

Constructor & Destructor Documentation

sg_gzifstream::sg_gzifstream ( )

Default constructor

Definition at line 33 of file sgstream.cxx.

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

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

Parameters
namename of file
io_modefile open mode(s) "or'd" together

Definition at line 42 of file sgstream.cxx.

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

Constructor that attaches itself to an existing file descriptor.

Parameters
fdfile descriptor
io_modefile open mode(s) "or'd" together

Definition at line 52 of file sgstream.cxx.

sg_gzifstream::sg_gzifstream ( const sg_gzifstream )
private

Member Function Documentation

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

Attach to an existing file descriptor.

Parameters
fdfile descriptor
io_modefile open mode(s) "or'd" together

Definition at line 91 of file sgstream.cxx.

void sg_gzifstream::close ( void  )
inline

Close the stream.

Definition at line 86 of file sgstream.hxx.

bool sg_gzifstream::is_open ( )
inline
Returns
true if the file is successfully opened, false otherwise.

Definition at line 89 of file sgstream.hxx.

Referenced by simgear::ReaderWriterSTG::_ModelBin::read(), and SGInterpTable::SGInterpTable().

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

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

Parameters
namename of file
io_modefile open mode(s) "or'd" together

Definition at line 67 of file sgstream.cxx.

Referenced by sg_gzifstream().

void sg_gzifstream::operator= ( const sg_gzifstream )
private

Friends And Related Function Documentation

std::istream & skipcomment ( std::istream &  in)
related

An istream manipulator that skips comments and white space. Ignores comments that start with '#'.

Parameters
ininput stream

Definition at line 133 of file sgstream.cxx.

std::istream & skipeol ( std::istream &  in)
related

An istream manipulator that skips to end of line.

Parameters
ininput stream

Definition at line 101 of file sgstream.cxx.

Referenced by main(), and skipcomment().

std::istream & skipws ( std::istream &  in)
related

An istream manipulator that skips over white space.

Parameters
ininput stream

Definition at line 119 of file sgstream.cxx.

Referenced by skipcomment().

Member Data Documentation

gzfilebuf gzifstream_base::gzbuf
inherited

Definition at line 145 of file zfstream.hxx.

Referenced by attach(), close(), is_open(), open(), and sg_gzifstream().


The documentation for this class was generated from the following files: