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

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

#include <szfstream.hpp>

Public Member Functions

 iszfstream ()
 Empty constructor. More...
 
 iszfstream (const std::string &filename)
 Constructor with a file name. Opens the file. More...
 
 iszfstream (const std::stringstream &ss)
 
std::istream * getStream ()
 Returns internal stream. More...
 
void open (const std::stringstream &ss)
 
void open (const std::string &filename)
 Opens a file. using boost: using fdstream: All three cases are handled with zcat -f,, which is piped (i.e. handled by another processor). More...
 
bool is_open ()
 Checks if the file/pipe is open. More...
 
 ~iszfstream ()
 Destructor. Closes the file. More...
 
virtual int eof ()
 Checks for end-of-file. More...
 
void close ()
 Closes file. More...
 
virtual operator void * ()
 Returns a pointer to itself or NULL if end-of-file reached. More...
 
virtual iszfstreamgetline (std::string &line)
 Read a line. More...
 

Friends

iszfstreamgetline (iszfstream &, std::string &)
 
template<typename T >
iszfstreamoperator>> (iszfstream &, T &)
 Templated operator >> for streaming out of iszfstream. More...
 

Detailed Description

Wrapper stream class that reads pipes, text files or gzipped files.

Definition at line 34 of file szfstream.hpp.

Constructor & Destructor Documentation

ucam::util::iszfstream::iszfstream ( )
inline

Empty constructor.

Definition at line 53 of file szfstream.hpp.

ucam::util::iszfstream::iszfstream ( const std::string &  filename)
inline

Constructor with a file name. Opens the file.

Definition at line 58 of file szfstream.hpp.

Here is the call graph for this function:

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

Definition at line 64 of file szfstream.hpp.

Here is the call graph for this function:

ucam::util::iszfstream::~iszfstream ( )
inline

Destructor. Closes the file.

Definition at line 137 of file szfstream.hpp.

Here is the call graph for this function:

Member Function Documentation

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

Closes file.

Definition at line 147 of file szfstream.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int ucam::util::iszfstream::eof ( )
inlinevirtual

Checks for end-of-file.

Definition at line 142 of file szfstream.hpp.

Here is the caller graph for this function:

iszfstream & ucam::util::iszfstream::getline ( std::string &  line)
inlinevirtual

Read a line.

Definition at line 183 of file szfstream.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::istream* ucam::util::iszfstream::getStream ( )
inline

Returns internal stream.

Definition at line 71 of file szfstream.hpp.

Here is the caller graph for this function:

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

Checks if the file/pipe is open.

Definition at line 132 of file szfstream.hpp.

Here is the caller graph for this function:

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

Definition at line 75 of file szfstream.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Opens a file. using boost: using fdstream: All three cases are handled with zcat -f,, which is piped (i.e. handled by another processor).

Parameters
filenameFile name to be opened.

Definition at line 86 of file szfstream.hpp.

Here is the call graph for this function:

virtual ucam::util::iszfstream::operator void * ( )
inlinevirtual

Returns a pointer to itself or NULL if end-of-file reached.

Definition at line 164 of file szfstream.hpp.

Here is the call graph for this function:

Friends And Related Function Documentation

iszfstream& getline ( iszfstream izs,
std::string &  line 
)
friend

Definition at line 178 of file szfstream.hpp.

template<typename T >
iszfstream& operator>> ( iszfstream iszf,
T &  stff 
)
friend

Templated operator >> for streaming out of iszfstream.

Definition at line 190 of file szfstream.hpp.


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