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

Method readLayerElement

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

Source from the content-addressed store, hash-verified

460}
461
462bool OriginAnyParser::readLayerElement()
463{
464 LOG_PRINT(logfile, "readLayerElement()\n")
465 /* get general info and details of a layer
466 * return true if a Layer is found, otherwise return false */
467 unsigned int lye_header_size = 0;
468 std::streamoff lyh_start = 0;
469
470 // get layer header size
471 lye_header_size = readObjectSize();
472 if (lye_header_size == 0)
473 return false;
474
475 curpos = file.tellg();
476 lyh_start = curpos;
477 LOG_PRINT(logfile,
478 " Layer found: header size %d [0x%X], starts at %" PRId64 " [0x%" PRIx64 "]\n",
479 lye_header_size, lye_header_size, curpos, curpos)
480 string lye_header = readObjectAsString(lye_header_size);
481
482 // get known info
483 LOG_PRINT(logfile, " Reading Layer properties ...\n")
484 getLayerProperties(lye_header, lye_header_size);
485
486 // go to end of layer header
487 file.seekg(lyh_start + lye_header_size + 1, ios_base::beg);
488
489 // get annotation list
490 unsigned int annotation_list_size = 0;
491
492 LOG_PRINT(logfile, " Reading Annotations ...\n")
493 /* Some annotations can be groups of annotations. We need a recursive function for those cases
494 */
495 annotation_list_size = readAnnotationList();
496 if (annotation_list_size > 0) {
497 LOG_PRINT(logfile, " ... done. Annotations: %u\n", annotation_list_size)
498 }
499
500 // get curve list
501 unsigned int curve_list_size = 0;
502
503 LOG_PRINT(logfile, " Reading Curves ...\n")
504 while (true) {
505 if (!readCurveElement())
506 break;
507 curve_list_size++;
508 }
509 LOG_PRINT(logfile, " ... done. Curves: %u\n", curve_list_size)
510
511 // get axisbreak list
512 unsigned int axisbreak_list_size = 0;
513
514 LOG_PRINT(logfile, " Reading Axis breaks ...\n")
515 while (true) {
516 if (!readAxisBreakElement())
517 break;
518 axisbreak_list_size++;
519 }

Callers

nothing calls this directly

Calls 2

tellgMethod · 0.45
seekgMethod · 0.45

Tested by

no test coverage detected