#include <OutputFileStream.h>
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. |
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.
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().
Moses::OutputFileStream::~OutputFileStream | ( | ) | [virtual] |
Definition at line 47 of file OutputFileStream.cpp.
References Close().
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] |
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().
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().