Moses::OutputFileStream Class Reference

#include <OutputFileStream.h>

List of all members.

Public Member Functions

 OutputFileStream ()
 OutputFileStream (const std::string &filePath)
 Create an OutputFileStream, and open it by calling Open().
virtual ~OutputFileStream ()
bool Open (const std::string &filePath)
void Close ()
 Flush and close stream. After this, the stream can be opened again.
 OutputFileStream ()
 OutputFileStream (const std::string &filePath)
 Create an OutputFileStream, and open it by calling Open().
virtual ~OutputFileStream ()
bool Open (const std::string &filePath)
void Close ()
 Flush and close stream. After this, the stream can be opened again.


Detailed Description

Version of std::ostream with transparent compression.

Transparently compresses output when writing to a file whose name ends in ".gz". Or, writes to stdout instead of a file when given a filename consisting of just a dash ("-").

Definition at line 39 of file OutputFileStream.h.


Constructor & Destructor Documentation

Moses::OutputFileStream::OutputFileStream (  ) 

Create an unopened OutputFileStream.

Until it's been opened, nothing can be done with this stream.

Definition at line 33 of file OutputFileStream.cpp.

Moses::OutputFileStream::OutputFileStream ( const std::string &  filePath  ) 

Create an OutputFileStream, and open it by calling Open().

Definition at line 40 of file OutputFileStream.cpp.

References Open().

Here is the call graph for this function:

Moses::OutputFileStream::~OutputFileStream (  )  [virtual]

Definition at line 47 of file OutputFileStream.cpp.

References Close().

Here is the call graph for this function:

Moses::OutputFileStream::OutputFileStream (  ) 

Create an unopened OutputFileStream.

Until it's been opened, nothing can be done with this stream.

Moses::OutputFileStream::OutputFileStream ( const std::string &  filePath  ) 

Create an OutputFileStream, and open it by calling Open().

virtual Moses::OutputFileStream::~OutputFileStream (  )  [virtual]


Member Function Documentation

void Moses::OutputFileStream::Close (  ) 

Flush and close stream. After this, the stream can be opened again.

void Moses::OutputFileStream::Close (  ) 

Flush and close stream. After this, the stream can be opened again.

Definition at line 74 of file OutputFileStream.cpp.

References NULL.

Referenced by main(), writeCountOfCounts(), writeLabelSet(), writeLeftHandSideLabelCounts(), Model::~Model(), and ~OutputFileStream().

Here is the caller graph for this function:

bool Moses::OutputFileStream::Open ( const std::string &  filePath  ) 

Open stream.

If filePath is "-" (just a dash), this opens the stream for writing to standard output. Otherwise, it opens the given file. If the filename has the ".gz" suffix, output will be transparently compressed.

Call Close() to close the file.

Returns whether opening the file was successful. It may also throw an exception on failure.

bool Moses::OutputFileStream::Open ( const std::string &  filePath  ) 

Open stream.

If filePath is "-" (just a dash), this opens the stream for writing to standard output. Otherwise, it opens the given file. If the filename has the ".gz" suffix, output will be transparently compressed.

Call Close() to close the file.

Returns whether opening the file was successful. It may also throw an exception on failure.

Definition at line 52 of file OutputFileStream.cpp.

Referenced by main(), MosesTraining::Syntax::Tool::OpenOutputFileOrDie(), OutputFileStream(), writeCountOfCounts(), writeLabelSet(), and writeLeftHandSideLabelCounts().

Here is the caller graph for this function:


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

Generated on Thu Jul 6 00:33:25 2017 for Moses by  doxygen 1.5.9