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

Method Count

src/io/textfile_reader.cc:50–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int TextFileReader::Count() {
51 std::ifstream fin(path_, std::ios::in);
52 CHECK(fin.is_open()) << "Cannot create file " << path_;
53 int count = 0;
54 string line;
55 while (!fin.eof()) {
56 std::getline(fin, line);
57 if (line != "") count++;
58 }
59 fin.close();
60 return count;
61}
62
63void TextFileReader::SeekToFirst() {
64 CHECK(fdat_.is_open());

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected