Cambridge SMT System
ucam::util::oszfstream Class Reference

Wrapper stream class that writes to pipes, text files or gzipped files. More...

#include <szfstream.hpp>

Public Types

typedef std::basic_ostream< char, std::char_traits< char > > CoutType
 
typedef CoutType &(* StandardEndLine) (CoutType &)
 

Public Member Functions

 oszfstream (const std::string &filename, bool append=false)
 Constructor. More...
 
 oszfstream (const std::stringstream &ss)
 Constructor. More...
 
std::ostream * getStream ()
 Returns internal stream. More...
 
void open (const std::stringstream &ss)
 
void open (const std::string &filename)
 Opens a [file]. More...
 
 ~oszfstream ()
 Destructor. Closes the file. More...
 
bool is_open ()
 Checks whether the file is open. More...
 
void close ()
 Closes the file. More...
 
oszfstreamoperator<< (StandardEndLine manip)
 Makes endl understandable when streaming towards this class. More...
 
template<typename T >
oszfstreamoperator<< (const T &stff)
 Templated operator << for streaming into filestream_. More...
 

Detailed Description

Wrapper stream class that writes to pipes, text files or gzipped files.

Remarks
Note that this class can be used in practice as any stream class.

Definition at line 200 of file szfstream.hpp.

Member Typedef Documentation

typedef std::basic_ostream<char, std::char_traits<char> > ucam::util::oszfstream::CoutType

Definition at line 337 of file szfstream.hpp.

typedef CoutType&( * ucam::util::oszfstream::StandardEndLine) (CoutType &)

Definition at line 340 of file szfstream.hpp.

Constructor & Destructor Documentation

ucam::util::oszfstream::oszfstream ( const std::string &  filename,
bool  append = false 
)
inline

Constructor.

Remarks
Opens a pipe or a (compressed) file.

Definition at line 223 of file szfstream.hpp.

Here is the call graph for this function:

ucam::util::oszfstream::oszfstream ( const std::stringstream &  ss)
inline

Constructor.

Remarks
Opens a stringstream.

Definition at line 235 of file szfstream.hpp.

Here is the call graph for this function:

ucam::util::oszfstream::~oszfstream ( )
inline

Destructor. Closes the file.

Definition at line 313 of file szfstream.hpp.

Here is the call graph for this function:

Member Function Documentation

void ucam::util::oszfstream::close ( )
inline

Closes the file.

Definition at line 323 of file szfstream.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream* ucam::util::oszfstream::getStream ( )
inline

Returns internal stream.

Definition at line 241 of file szfstream.hpp.

Here is the caller graph for this function:

bool ucam::util::oszfstream::is_open ( )
inline

Checks whether the file is open.

Definition at line 318 of file szfstream.hpp.

Here is the caller graph for this function:

void ucam::util::oszfstream::open ( const std::stringstream &  ss)
inline

Definition at line 245 of file szfstream.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ucam::util::oszfstream::open ( const std::string &  filename)
inline

Opens a [file].

Parameters
filename[file], which could be - for a pipe. If it ends in .gz then it will compress.

Definition at line 255 of file szfstream.hpp.

Here is the call graph for this function:

oszfstream& ucam::util::oszfstream::operator<< ( StandardEndLine  manip)
inline

Makes endl understandable when streaming towards this class.

Definition at line 343 of file szfstream.hpp.

template<typename T >
oszfstream& ucam::util::oszfstream::operator<< ( const T &  stff)
inline

Templated operator << for streaming into filestream_.

Definition at line 350 of file szfstream.hpp.


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