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

Function my_getline

IO/Infovis/vtkFixedWidthTextReader.cxx:255–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253//------------------------------------------------------------------------------
254
255static int my_getline(istream& in, std::string& out, char delimiter)
256{
257 out = std::string();
258 unsigned int numCharactersRead = 0;
259 int nextValue = 0;
260
261 while ((nextValue = in.get()) != EOF && numCharactersRead < out.max_size())
262 {
263 ++numCharactersRead;
264
265 char downcast = static_cast<char>(nextValue);
266 if (downcast != delimiter && downcast != 0x0d)
267 {
268 out += downcast;
269 }
270 else
271 {
272 return numCharactersRead;
273 }
274 }
275
276 return numCharactersRead;
277}
278VTK_ABI_NAMESPACE_END

Callers 1

RequestDataMethod · 0.70

Calls 3

stringClass · 0.50
getMethod · 0.45
max_sizeMethod · 0.45

Tested by

no test coverage detected