MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ReadLineHelper

Method ReadLineHelper

tensorflow/core/lib/io/buffered_inputstream.cc:59–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59Status BufferedInputStream::ReadLineHelper(string* result, bool include_eol) {
60 result->clear();
61 Status s;
62 while (true) {
63 if (pos_ == limit_) {
64 // Get more data into buffer
65 s = FillBuffer();
66 if (limit_ == 0) {
67 break;
68 }
69 }
70 char c = buf_[pos_++];
71 if (c == '\n') {
72 if (include_eol) {
73 *result += c;
74 }
75 return Status::OK();
76 }
77 // We don't append '\r' to *result
78 if (c != '\r') {
79 *result += c;
80 }
81 }
82 if (errors::IsOutOfRange(s) && !result->empty()) {
83 return Status::OK();
84 }
85 return s;
86}
87
88Status BufferedInputStream::ReadNBytes(int64 bytes_to_read, string* result) {
89 if (bytes_to_read < 0) {

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected