MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / loadPageFromSectionFile

Method loadPageFromSectionFile

lib/Epub/Epub/Section.cpp:314–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314std::unique_ptr<Page> Section::loadPageFromSectionFile() {
315 if (!Storage.openFileForRead("SCT", filePath, file)) {
316 return nullptr;
317 }
318
319 file.seek(HEADER_SIZE - sizeof(uint32_t) * 4);
320 uint32_t lutOffset;
321 serialization::readPod(file, lutOffset);
322 file.seek(lutOffset + sizeof(uint32_t) * currentPage);
323 uint32_t pagePos;
324 serialization::readPod(file, pagePos);
325 file.seek(pagePos);
326
327 auto page = Page::deserialize(file);
328 // Explicit close() required: member variable persists beyond function scope
329 file.close();
330 return page;
331}
332
333std::string Section::getTextFromSectionFile() {
334 std::string fullText;

Callers 2

renderMethod · 0.80

Calls 4

readPodFunction · 0.85
openFileForReadMethod · 0.80
seekMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected