Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild

This commit is contained in:
jpirnay
2026-03-28 16:23:11 +01:00
5 changed files with 23 additions and 0 deletions
@@ -84,6 +84,14 @@ class ChapterHtmlSlimParser {
int xpathBodyDepth = -1; // depth of the <body> element (-1 = not yet seen)
std::vector<uint16_t> paragraphIndexPerPage; // <p> index at each page completion
// Paragraph index tracking for XPath-to-page lookup table.
// Counts <p> sibling indices (1-based, matching XPath convention) during page building.
// Stored per page in the section cache so that XPath p[N] can be resolved to a page
// without reparsing, and current page can generate an XPath without reparsing.
uint16_t xpathParagraphIndex = 0; // current <p> sibling index (1-based)
int xpathBodyDepth = -1; // depth of the <body> element (-1 = not yet seen)
std::vector<uint16_t> paragraphIndexPerPage; // <p> index at each page completion
// Footnote link tracking
bool insideFootnoteLink = false;
int footnoteLinkDepth = -1;
+3
View File
@@ -176,5 +176,8 @@ HalFile HalFile::openNextFile() {
assert(impl != nullptr);
return HalFile(std::make_unique<Impl>(impl->file.openNextFile()));
}
bool HalFile::getModifyDateTime(uint16_t* pdate, uint16_t* ptime) {
HAL_FILE_WRAPPED_CALL(getModifyDateTime, pdate, ptime);
}
bool HalFile::isOpen() const { return impl != nullptr && impl->file.isOpen(); } // already thread-safe, no need to wrap
HalFile::operator bool() const { return isOpen(); }
+1
View File
@@ -95,6 +95,7 @@ class HalFile : public Print {
void rewindDirectory();
bool close();
HalFile openNextFile();
bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime);
bool isOpen() const;
operator bool() const;
};