1 /*=============================================================================
2 Copyright (c) 2011 Daniel James
4 Use, modification and distribution is subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
9 #if !defined(BOOST_QUICKBOOK_ID_MANAGER_HPP)
10 #define BOOST_QUICKBOOK_ID_MANAGER_HPP
12 #include <boost/scoped_ptr.hpp>
20 // Higher categories get priority over lower ones.
27 numbered, // Just used to avoid random docbook ids
28 generated, // Generated ids for other elements.
29 generated_heading, // Generated ids for headings.
30 generated_section, // Generated ids for sections.
31 generated_doc, // Generated ids for document.
32 explicit_id, // Explicitly given by user
37 id_category() : c(default_category) {}
38 id_category(categories c) : c(c) {}
39 explicit id_category(int c) : c(categories(c)) {}
41 bool operator==(id_category rhs) const { return c == rhs.c; }
47 struct section_manager;
54 std::string start_file_with_docinfo(
55 unsigned compatibility_version,
56 std::string const& include_doc_id,
57 std::string const& id,
61 unsigned compatibility_version,
62 std::string const& include_doc_id,
63 std::string const& id,
68 std::string begin_section(std::string const&, id_category);
70 int section_level() const;
72 std::string old_style_id(std::string const&, id_category);
73 std::string add_id(std::string const&, id_category);
74 std::string add_anchor(std::string const&, id_category);
76 std::string replace_placeholders_with_unresolved_ids(
77 std::string const&) const;
78 std::string replace_placeholders(std::string const&) const;
80 unsigned compatibility_version() const;
82 boost::scoped_ptr<id_state> state;