MCPcopy Create free account
hub / github.com/KDE/labplot / readObjectAsString

Method readObjectAsString

src/3rdparty/liborigin/OriginAnyParser.cpp:244–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244string OriginAnyParser::readObjectAsString(unsigned int size)
245{
246 // read a size-byte blob of data followed by '\n'
247 if (size > 0) {
248 char c;
249 // get a string large enough to hold the result, initialize it to all 0's
250 string blob = string(size, '\0');
251 // read data into that string
252 // cannot use '>>' operator because iendianfstream truncates it at first '\0'
253 file.read(&blob[0], size);
254 // read the '\n'
255 file >> c;
256 if (c != '\n') {
257 curpos = file.tellg();
258 LOG_PRINT(logfile, "Wrong delimiter %c at %" PRId64 " [0x%" PRIx64 "]\n", c, curpos,
259 curpos)
260 parseError = 4;
261 return string();
262 }
263 return blob;
264 }
265 return string();
266}
267
268void OriginAnyParser::readFileVersion()
269{

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
tellgMethod · 0.45

Tested by

no test coverage detected