| 807 | } |
| 808 | |
| 809 | BookMetadataCache::TocEntry Epub::getTocItem(const int tocIndex) const { |
| 810 | if (!bookMetadataCache || !bookMetadataCache->isLoaded()) { |
| 811 | LOG_DBG("EBP", "getTocItem called but cache not loaded"); |
| 812 | return {}; |
| 813 | } |
| 814 | |
| 815 | if (tocIndex < 0 || tocIndex >= bookMetadataCache->getTocCount()) { |
| 816 | LOG_DBG("EBP", "getTocItem index:%d is out of range", tocIndex); |
| 817 | return {}; |
| 818 | } |
| 819 | |
| 820 | return bookMetadataCache->getTocEntry(tocIndex); |
| 821 | } |
| 822 | |
| 823 | int Epub::getTocItemsCount() const { |
| 824 | if (!bookMetadataCache || !bookMetadataCache->isLoaded()) { |
no test coverage detected