-/// Caption-enabled TOC builders
-class TocBuilder
-{
-public:
- TocBuilder(std::shared_ptr<Toc> toc);
- /// When entering a float or flex or paragraph (with AddToToc)
- void pushItem(DocIterator const & dit, docstring const & s,
- bool output_active, bool is_captioned = false);
- /// When encountering a float caption
- void captionItem(DocIterator const & dit, docstring const & s,
- bool output_active);
- /// When encountering an argument (with isTocCaption) for flex or paragraph
- void argumentItem(docstring const & arg_str);
- /// When exiting a float or flex or paragraph
- void pop();
-private:
- TocBuilder(){}
- ///
- struct frame {
- Toc::size_type pos;
- bool is_captioned;
- };
- ///
- std::shared_ptr<Toc> const toc_;
- ///
- std::stack<frame> stack_;
-};
-
-