MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadLine

Method ReadLine

IO/Legacy/vtkDataReader.cxx:254–277  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Internal function to read in a line up to 256 characters. Returns zero if there was an error.

Source from the content-addressed store, hash-verified

252// Internal function to read in a line up to 256 characters.
253// Returns zero if there was an error.
254int vtkDataReader::ReadLine(char result[256])
255{
256 this->IS->getline(result, 256);
257 if (this->IS->fail())
258 {
259 if (this->IS->eof())
260 {
261 return 0;
262 }
263 if (this->IS->gcount() == 255)
264 {
265 // Read 256 chars; ignoring the rest of the line.
266 this->IS->clear();
267 this->IS->ignore(VTK_INT_MAX, '\n');
268 }
269 }
270 // remove '\r', if present.
271 size_t slen = strlen(result);
272 if (slen > 0 && result[slen - 1] == '\r')
273 {
274 result[slen - 1] = '\0';
275 }
276 return 1;
277}
278
279//------------------------------------------------------------------------------
280// Internal function to read in a string up to 256 characters.

Callers 15

ReadHeaderMethod · 0.95
ReadArrayMethod · 0.95
ReadInformationMethod · 0.95
CharacterizeFileMethod · 0.95
RequestDataMethod · 0.45
RequestDataMethod · 0.45
RequestDataMethod · 0.45
ReadASCIISTLMethod · 0.45
RequestDataMethod · 0.45
ReadHeaderDataMethod · 0.45
ReadCompositeDataMethod · 0.45
ReadEncodedBlockFunction · 0.45

Calls 2

eofMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected