#include <kaldi-io.h>
Public Member Functions | |
Output (const std::string &filename, bool binary, bool write_header=true) | |
Output () | |
bool | Open (const std::string &wxfilename, bool binary, bool write_header) |
This opens the stream, with the given mode (binary or text). More... | |
bool | IsOpen () |
std::ostream & | Stream () |
bool | Close () |
~Output () | |
Private Member Functions | |
KALDI_DISALLOW_COPY_AND_ASSIGN (Output) | |
Private Attributes | |
OutputImplBase * | impl_ |
std::string | filename_ |
Definition at line 124 of file kaldi-io.h.
Definition at line 665 of file kaldi-io.cc.
References Output::impl_, KALDI_ERR, Output::Open(), and kaldi::PrintableWxfilename().
|
inline |
Definition at line 131 of file kaldi-io.h.
References Output::Close(), Output::IsOpen(), Output::Open(), Output::Stream(), and Output::~Output().
~Output | ( | ) |
Definition at line 688 of file kaldi-io.cc.
References kaldi::ClassifyWxfilename(), OutputImplBase::Close(), Output::filename_, Output::impl_, KALDI_ERR, kaldi::kFileOutput, and kaldi::PrintableWxfilename().
Referenced by Output::Output().
bool Close | ( | ) |
Definition at line 677 of file kaldi-io.cc.
References OutputImplBase::Close(), and Output::impl_.
Referenced by Input::Input(), main(), Output::Open(), Output::Output(), kaldi::TestEventTypeIo(), kaldi::TestGenRandContextDependency(), kaldi::UnitTestIoNew(), kaldi::UnitTestIoPipe(), kaldi::UnitTestReadScriptFile(), Nnet::Write(), TableWriterScriptImpl< Holder >::Write(), kaldi::WriteIntegerVectorSimple(), and kaldi::WriteIntegerVectorVectorSimple().
|
inline |
Definition at line 38 of file kaldi-io-inl.h.
References Input::impl_.
Referenced by Input::Input(), Output::Open(), and Output::Output().
|
private |
This opens the stream, with the given mode (binary or text).
It returns true on success and false on failure. However, it will throw if something was already open and could not be closed (to avoid this, call Close() first. if write_header == true and binary == true, it writes the Kaldi binary-mode header ('\0' then 'B'). You may call Open even if it is already open; it will close the existing stream and reopen (however if closing the old stream failed it will throw).
Definition at line 707 of file kaldi-io.cc.
References kaldi::ClassifyWxfilename(), Output::Close(), Output::filename_, Output::impl_, kaldi::InitKaldiOutputStream(), Output::IsOpen(), KALDI_ASSERT, KALDI_ERR, KALDI_WARN, kaldi::kFileOutput, kaldi::kPipeOutput, kaldi::kStandardOutput, OutputImplBase::Open(), kaldi::PrintableWxfilename(), and OutputImplBase::Stream().
Referenced by Input::Input(), Output::Output(), TableWriterScriptImpl< Holder >::Write(), kaldi::WriteIntegerVectorSimple(), kaldi::WriteIntegerVectorVectorSimple(), and kaldi::WriteScriptFile().
std::ostream & Stream | ( | ) |
Definition at line 701 of file kaldi-io.cc.
References Output::impl_, KALDI_ERR, and OutputImplBase::Stream().
Referenced by Input::Input(), main(), Output::Output(), kaldi::TestEventTypeIo(), kaldi::TestFmpe(), kaldi::TestGenRandContextDependency(), kaldi::nnet2::UnitTestGenericComponentInternal(), kaldi::UnitTestIoNew(), kaldi::UnitTestIoPipe(), kaldi::UnitTestIoStandard(), kaldi::UnitTestRangesMatrix(), kaldi::UnitTestReadScriptFile(), Nnet::Write(), TableWriterScriptImpl< Holder >::Write(), fst::WriteFstKaldi(), kaldi::WriteIntegerVectorSimple(), kaldi::WriteIntegerVectorVectorSimple(), kaldi::WriteKaldiObject(), kaldi::WriteScriptFile(), NnetChainTrainer::~NnetChainTrainer(), NnetDiscriminativeTrainer::~NnetDiscriminativeTrainer(), and NnetTrainer::~NnetTrainer().
|
private |
Definition at line 161 of file kaldi-io.h.
Referenced by Output::Open(), and Output::~Output().
|
private |
Definition at line 160 of file kaldi-io.h.
Referenced by Output::Close(), Output::Open(), Output::Output(), Output::Stream(), and Output::~Output().