Definition at line 453 of file kaldi-io.cc.
◆ PipeInputImpl()
◆ ~PipeInputImpl()
◆ Close()
◆ MyType()
◆ Open()
virtual bool Open |
( |
const std::string & |
rxfilename, |
|
|
bool |
binary |
|
) |
| |
|
inlinevirtual |
Implements InputImplBase.
Definition at line 457 of file kaldi-io.cc.
References KALDI_ASSERT, KALDI_WARN, and kaldi::PrintableRxfilename().
461 rxfilename[rxfilename.length()-1] ==
'|');
462 std::string cmd_name(rxfilename, 0, rxfilename.length()-1);
463 #if defined(_MSC_VER) || defined(__CYGWIN__) 464 f_ = popen(cmd_name.c_str(), (binary ?
"rb" :
"r"));
466 f_ = popen(cmd_name.c_str(),
"r");
470 KALDI_WARN <<
"Failed opening pipe for reading, command is: " 471 << cmd_name <<
", errno is " << strerror(errno);
477 (binary ? std::ios_base::in|
478 std::ios_base::binary
479 :std::ios_base::in));
481 is_ =
new std::istream(
fb_);
483 is_ =
new std::ifstream(f_);
485 if (
is_->fail() ||
is_->bad())
return false;
basic_pipebuf< char > PipebufType
#define KALDI_ASSERT(cond)
std::string PrintableRxfilename(const std::string &rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
◆ Stream()
virtual std::istream& Stream |
( |
| ) |
|
|
inlinevirtual |
◆ f_
◆ fb_
◆ filename_
◆ is_
The documentation for this class was generated from the following file: