MCPcopy Create free account
hub / github.com/apache/singa / Read

Method Read

src/io/textfile_reader.cc:36–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool TextFileReader::Read(std::string* key, std::string* value) {
37 CHECK(fdat_.is_open()) << "File not open!";
38 key->clear();
39 value->clear();
40 if (!std::getline(fdat_, *value)) {
41 if (fdat_.eof())
42 return false;
43 else
44 LOG(FATAL) << "Error in reading text file";
45 }
46 *key = std::to_string(lineNo_++);
47 return true;
48}
49
50int TextFileReader::Count() {
51 std::ifstream fin(path_, std::ios::in);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected