#pragma once #include #include #include struct Bookmark { int16_t spineIndex; int16_t pageNumber; std::string snippet; // First sentence or text excerpt from the page }; class BookmarkStore { public: static std::vector load(const std::string& cachePath); static bool save(const std::string& cachePath, const std::vector& bookmarks); static bool addBookmark(const std::string& cachePath, int spineIndex, int page, const std::string& snippet = ""); static bool removeBookmark(const std::string& cachePath, int spineIndex, int page); static bool hasBookmark(const std::string& cachePath, int spineIndex, int page); private: static std::string filePath(const std::string& cachePath); static constexpr int MAX_BOOKMARKS = 200; static constexpr int MAX_SNIPPET_LENGTH = 120; };