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

Method getSpineEntry

lib/Epub/Epub/BookMetadataCache.cpp:406–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406BookMetadataCache::SpineEntry BookMetadataCache::getSpineEntry(const int index) {
407 if (!loaded) {
408 LOG_ERR("BMC", "getSpineEntry called but cache not loaded");
409 return {};
410 }
411
412 if (index < 0 || index >= static_cast<int>(spineCount)) {
413 LOG_ERR("BMC", "getSpineEntry index %d out of range", index);
414 return {};
415 }
416
417 // Seek to spine LUT item, read from LUT and get out data
418 bookFile.seek(lutOffset + sizeof(uint32_t) * index);
419 uint32_t spineEntryPos;
420 serialization::readPod(bookFile, spineEntryPos);
421 bookFile.seek(spineEntryPos);
422 return readSpineEntry(bookFile);
423}
424
425BookMetadataCache::TocEntry BookMetadataCache::getTocEntry(const int index) {
426 if (!loaded) {

Callers 1

getSpineItemMethod · 0.80

Calls 2

readPodFunction · 0.85
seekMethod · 0.80

Tested by

no test coverage detected