1 // Boost.Geometry (aka GGL, Generic Geometry Library) 2 // 3 // Copyright (c) 2010-2013 Barend Gehrels, Amsterdam, the Netherlands. 4 // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. 5 // Use, modification and distribution is subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 // 9 // 10 #ifndef DOXYGEN_ELEMENTS_HPP 11 #define DOXYGEN_ELEMENTS_HPP 12 13 14 #include <string> 15 #include <vector> 16 17 18 enum markup_type { markup_default, markup_synopsis }; 19 enum markup_order_type { markup_any, markup_before, markup_after }; 20 21 // TODO: rename, not all are functions 22 enum function_type 23 { 24 function_unknown, 25 function_define, 26 function_constructor_destructor, 27 function_member, 28 function_free, 29 }; 30 31 struct base_element 32 { 33 std::string name; 34 std::string brief_description; 35 36 bool skip; 37 38 std::string id; 39 base_elementbase_element40 base_element(std::string const& n = "") 41 : name(n) 42 , skip(false) 43 {} 44 }; 45 46 47 // contains (template)parameter 48 struct parameter : public base_element 49 { 50 std::string type; 51 std::string default_value; // for template parameters 52 std::string fulltype; // post-processed 53 std::string fulltype_without_links; 54 }; 55 56 struct enumeration_value : public base_element 57 { 58 std::string initializer; 59 }; 60 61 62 63 struct markup 64 { 65 std::string value; 66 markup_order_type order; 67 markup_type type; 68 markupmarkup69 markup(std::string const& v = "") 70 : value(v) 71 , order(markup_any) 72 , type(markup_default) 73 { 74 init(); 75 } 76 markupmarkup77 markup(markup_order_type o, markup_type t, std::string const& v = "") 78 : value(v) 79 , order(o) 80 , type(t) 81 { 82 init(); 83 } 84 initmarkup85 void init() 86 { 87 boost::trim(value); 88 boost::replace_all(value, "\\*", "*"); 89 } 90 }; 91 92 struct paragraph 93 { 94 std::string title; 95 std::string text; 96 }; 97 98 // Base of a class/struct, function, define 99 struct element : public base_element 100 { 101 std::string detailed_description; 102 std::string location; 103 int line; // To sort - Doxygen changes order - we change it back 104 105 // QBK-includes 106 // Filled with e.g.: \qbk([include reference/myqbk.qbk]} 107 std::vector<markup> qbk_markup; 108 109 // To distinguish overloads: unary, binary etc, 110 // Filled with: \qbk{distinguish,<A discerning description>} 111 std::string additional_description; 112 113 std::vector<parameter> template_parameters; 114 std::vector<parameter> parameters; 115 116 std::vector<paragraph> paragraphs; 117 std::string warning; 118 std::string note; 119 elementelement120 element() 121 : line(0) 122 {} 123 }; 124 125 126 struct function : public element 127 { 128 function_type type; 129 std::string definition, argsstring; 130 std::string return_type, return_description; 131 std::string precondition; 132 133 std::string return_type_without_links; 134 bool unique; 135 bool is_static, is_const, is_explicit, is_virtual; 136 functionfunction137 function() 138 : type(function_unknown) 139 , unique(true) 140 , is_static(false), is_const(false), is_explicit(false), is_virtual(false) 141 {} 142 143 }; 144 145 146 struct enumeration : public element 147 { 148 std::vector<enumeration_value> enumeration_values; 149 }; 150 151 152 struct base_class 153 { 154 std::string name; 155 std::string derivation; // "prot" element 156 std::string virtuality; // "virt" element 157 }; 158 159 struct class_or_struct : public element 160 { 161 bool is_class; // true if class, false if struct 162 std::string name, fullname; 163 std::vector<function> functions; 164 165 std::vector<base_element> typedefs; 166 std::vector<parameter> variables; 167 168 std::vector<base_class> base_classes; 169 }; 170 171 172 struct documentation 173 { 174 std::string group_id; 175 std::string group_title; 176 177 // Only one expected (no grouping) 178 class_or_struct cos; 179 180 // There can be many of them (in groups): 181 std::vector<function> functions; 182 std::vector<function> defines; 183 std::vector<enumeration> enumerations; 184 }; 185 186 187 #endif // DOXYGEN_ELEMENTS_HPP 188