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

Method read

src/3rdparty/vector_blf/src/Vector/BLF/ObjectHeaderBase.cpp:18–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 }
17
18 void ObjectHeaderBase::read(AbstractFile& is) {
19 /* let us be more robust, when reading */
20 uint32_t tmp = 0;
21 while (tmp != ObjectSignature) {
22 is.read(reinterpret_cast<char *>(&tmp), sizeof(tmp));
23 if (tmp == ObjectSignature) {
24 signature = tmp;
25 } else {
26 if (is.eof()) {
27 throw Exception("ObjectHeaderBase::read(): End of File.");
28 }
29
30 if ((0xffffff00 & tmp) == 0x424f4c00) {
31 is.seekg(-3, std::ios_base::cur);
32 } else if ((0xffff0000 & tmp) == 0x4f4c0000) {
33 is.seekg(-2, std::ios_base::cur);
34 } else if ((0xff000000 & tmp) == 0x4c000000) {
35 is.seekg(-1, std::ios_base::cur);
36 } else {
37 /* do not seek as we did not find a single char */
38 }
39 }
40 }
41 is.read(reinterpret_cast<char*>(&headerSize), sizeof(headerSize));
42 is.read(reinterpret_cast<char*>(&headerVersion), sizeof(headerVersion));
43 is.read(reinterpret_cast<char*>(&objectSize), sizeof(objectSize));
44 is.read(reinterpret_cast<char*>(&objectType), sizeof(objectType));
45 }
46
47 void ObjectHeaderBase::write(AbstractFile& os) {
48 /* pre processing */

Callers

nothing calls this directly

Calls 2

eofMethod · 0.45
seekgMethod · 0.45

Tested by

no test coverage detected