| 351 | } |
| 352 | |
| 353 | std::optional<uint16_t> Section::getCachedPageCount() const { |
| 354 | HalFile f; |
| 355 | if (!Storage.openFileForRead("SCT", filePath, f)) { |
| 356 | return std::nullopt; |
| 357 | } |
| 358 | |
| 359 | const uint32_t fileSize = f.size(); |
| 360 | if (fileSize < HEADER_SIZE) { |
| 361 | return std::nullopt; |
| 362 | } |
| 363 | |
| 364 | f.seek(HEADER_SIZE - sizeof(uint32_t) * 4 - sizeof(uint16_t)); |
| 365 | uint16_t count; |
| 366 | serialization::readPod(f, count); |
| 367 | return count; |
| 368 | } |
| 369 | |
| 370 | std::optional<uint16_t> Section::getPageForAnchor(const std::string& anchor) const { |
| 371 | HalFile f; |
no test coverage detected