|
static void | SplitFilename (const std::string &rxfilename, std::string *filename, size_t *offset) |
|
Definition at line 556 of file kaldi-io.cc.
◆ ~OffsetFileInputImpl()
◆ Close()
◆ MyType()
◆ Open()
virtual bool Open |
( |
const std::string & |
rxfilename, |
|
|
bool |
binary |
|
) |
| |
|
inlinevirtual |
Implements InputImplBase.
Definition at line 602 of file kaldi-io.cc.
References MapOsPath.
607 std::string tmp_filename;
617 binary ? std::ios_base::in | std::ios_base::binary
618 : std::ios_base::in);
619 if (!
is_.is_open())
return false;
628 binary ? std::ios_base::in | std::ios_base::binary
629 : std::ios_base::in);
630 if (!
is_.is_open())
return false;
◆ Seek()
Definition at line 578 of file kaldi-io.cc.
References rnnlm::i.
579 size_t cur_pos =
is_.tellg();
580 if (cur_pos == offset)
return true;
581 else if (cur_pos<offset && cur_pos+100 > offset) {
584 for (
size_t i = cur_pos;
i < offset;
i++)
586 return (
is_.tellg() == std::streampos(offset));
589 is_.seekg(offset, std::ios_base::beg);
◆ SplitFilename()
static void SplitFilename |
( |
const std::string & |
rxfilename, |
|
|
std::string * |
filename, |
|
|
size_t * |
offset |
|
) |
| |
|
inlinestatic |
Definition at line 562 of file kaldi-io.cc.
References kaldi::ConvertStringToInteger(), KALDI_ASSERT, and KALDI_ERR.
565 size_t pos = rxfilename.find_last_of(
':');
569 *filename = std::string(rxfilename, 0, pos);
570 std::string number(rxfilename, pos+1);
573 KALDI_ERR <<
"Cannot get offset from filename " << rxfilename
574 <<
" (possibly you compiled in 32-bit and have a >32-bit" 575 <<
" byte offset into a file; you'll have to compile 64-bit.";
bool ConvertStringToInteger(const std::string &str, Int *out)
Converts a string into an integer via strtoll and returns false if there was any kind of problem (i...
#define KALDI_ASSERT(cond)
◆ Stream()
virtual std::istream& Stream |
( |
| ) |
|
|
inlinevirtual |
◆ binary_
◆ filename_
◆ is_
The documentation for this class was generated from the following file: