//======================================================================== // // This file is under the GPLv2 or later license // // Copyright (C) 2005-2006 Kristian Høgsberg // Copyright (C) 2005, 2018-2020 Albert Astals Cid // Copyright (C) 2018 Adam Reichold // Copyright (C) 2019 Oliver Sander // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== #ifndef PAGELABELINFO_H #define PAGELABELINFO_H #include #include #include #include #include #include #include #include "Object.h" class PageLabelInfo { public: PageLabelInfo(Object *tree, int numPages); PageLabelInfo(const PageLabelInfo &) = delete; PageLabelInfo &operator=(const PageLabelInfo &) = delete; bool labelToIndex(GooString *label, int *index) const; bool indexToLabel(int index, GooString *label) const; private: void parse(const Object *tree, std::set &parsedRefs); private: struct Interval { Interval(Object *dict, int baseA); std::string prefix; enum NumberStyle { None, Arabic, LowercaseRoman, UppercaseRoman, UppercaseLatin, LowercaseLatin } style; int first, base, length; }; std::vector intervals; }; #endif