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

Method getTextFromSectionFile

lib/Epub/Epub/Section.cpp:333–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333std::string Section::getTextFromSectionFile() {
334 std::string fullText;
335 auto p = this->loadPageFromSectionFile();
336 if (p) {
337 for (const auto& el : p->elements) {
338 if (el->getTag() == TAG_PageLine) {
339 const auto& line = static_cast<const PageLine&>(*el);
340 if (line.getBlock()) {
341 const auto& words = line.getBlock()->getWords();
342 for (const auto& w : words) {
343 if (!fullText.empty()) fullText += " ";
344 fullText += w;
345 }
346 }
347 }
348 }
349 }
350 return fullText;
351}
352
353std::optional<uint16_t> Section::getCachedPageCount() const {
354 HalFile f;

Callers 2

onReaderMenuConfirmMethod · 0.80
addBookmarkMethod · 0.80

Calls 3

getTagMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected