Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82393 - in sandbox-branches/geometry/index/doc: . html html/geometry_index/r_tree src/tools src/tools/doxygen_xml2qbk src/tools/doxygen_xml2qbk/contrib src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13
From: adam.wulkiewicz_at_[hidden]
Date: 2013-01-07 18:15:59


Author: awulkiew
Date: 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
New Revision: 82393
URL: http://svn.boost.org/trac/boost/changeset/82393

Log:
Docs improved.
Added alternative version of doxygen_xml2qbk.
Added:
   sandbox-branches/geometry/index/doc/src/tools/
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/Jamfile.v2 (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/configuration.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/license.txt (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/manual.html (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_iterators.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_print.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_utils.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/readme.txt (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_elements.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml2qbk.suo (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/file_to_string.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/parameter_predicates.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/quickbook_output.hpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/rapidxml_util.hpp (contents, props changed)
Text files modified:
   sandbox-branches/geometry/index/doc/Jamfile.v2 | 2
   sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/index.html | 2186 +++++++++++++++++++++++++++++++++++++++
   sandbox-branches/geometry/index/doc/html/index.html | 2
   3 files changed, 2178 insertions(+), 12 deletions(-)

Modified: sandbox-branches/geometry/index/doc/Jamfile.v2
==============================================================================
--- sandbox-branches/geometry/index/doc/Jamfile.v2 (original)
+++ sandbox-branches/geometry/index/doc/Jamfile.v2 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -24,7 +24,7 @@
     <xsl:param>chunk.first.sections=1
     <xsl:param>toc.section.depth=3
     <xsl:param>toc.max.depth=2
- <xsl:param>generate.section.toc.level=4
+ <xsl:param>generate.section.toc.level=2
     <xsl:param>boost.root=http://www.boost.org/doc/libs/release
     
     <quickbook-define>enable_index

Modified: sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/index.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/index.html (original)
+++ sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/index.html 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -31,7 +31,7 @@
 <a name="geometry_index.r_tree.index.boost_geometry_index_rtree"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree" title="boost::geometry::index::rtree">boost::geometry::index::rtree</a>
 </h4></div></div></div>
 <p>
- <a class="indexterm" name="id853103"></a><a class="indexterm" name="id853107"></a><a class="indexterm" name="id853112"></a><a class="indexterm" name="id853117"></a>
+ <a class="indexterm" name="id838903"></a><a class="indexterm" name="id838908"></a><a class="indexterm" name="id838913"></a><a class="indexterm" name="id838918"></a>
 The R-tree spatial index.
         </p>
 <h6>
@@ -64,6 +64,13 @@
         </p>
 <h6>
 <a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.header"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.header">Header</a>
+ </h6>
+<p>
+ <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h2"></a>
           <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.synopsis">Synopsis</a>
         </h6>
 <p>
@@ -80,7 +87,7 @@
 <p>
         </p>
 <h6>
-<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h2"></a>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h3"></a>
           <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.template_parameter_s_"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.template_parameter_s_">Template
           parameter(s)</a>
         </h6>
@@ -154,7 +161,7 @@
 </tbody>
 </table></div>
 <h6>
-<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h3"></a>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h4"></a>
           <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.typedef_s_"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.typedef_s_">Typedef(s)</a>
         </h6>
 <div class="informaltable"><table class="table">
@@ -262,7 +269,7 @@
 </tbody>
 </table></div>
 <h6>
-<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h4"></a>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h5"></a>
           <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.constructor_s__and_destructor"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.constructor_s__and_destructor">Constructor(s)
           and destructor</a>
         </h6>
@@ -377,7 +384,7 @@
 </tbody>
 </table></div>
 <h6>
-<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h5"></a>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h6"></a>
           <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.member_s_"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.member_s_">Member(s)</a>
         </h6>
 <div class="informaltable"><table class="table">
@@ -692,13 +699,2172 @@
 </tr>
 </tbody>
 </table></div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__" title="rtree()">rtree()</a>
+</h5></div></div></div>
 <h6>
-<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.h6"></a>
- <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.header"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.header">Header</a>
- </h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.synopsis">Synopsis</a>
+ </h6>
 <p>
- <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
- </p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span><span class="special">(</span><span class="identifier">parameters_type</span> <span class="identifier">parameters</span> <span class="special">=</span> <span class="identifier">parameters_type</span><span class="special">(),</span>
+ <span class="identifier">translator_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">translator</span> <span class="special">=</span> <span class="identifier">translator_type</span><span class="special">(),</span>
+ <span class="identifier">allocator_type</span> <span class="identifier">allocator</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">())</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.description">Description</a>
+ </h6>
+<p>
+ The constructor.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree__.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>parameters_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'parameters'
+ </p>
+ </td>
+<td>
+ <p>
+ The parameters object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>translator_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'translator'
+ </p>
+ </td>
+<td>
+ <p>
+ The translator object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>allocator_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'allocator'
+ </p>
+ </td>
+<td>
+ <p>
+ The allocator object.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_" title="rtree(Iterator, Iterator)">rtree(Iterator,
+ Iterator)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
+<span class="identifier">rtree</span><span class="special">(</span><span class="identifier">Iterator</span> <span class="identifier">first</span><span class="special">,</span>
+ <span class="identifier">Iterator</span> <span class="identifier">last</span><span class="special">,</span>
+ <span class="identifier">parameters_type</span> <span class="identifier">parameters</span> <span class="special">=</span> <span class="identifier">parameters_type</span><span class="special">(),</span>
+ <span class="identifier">translator_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">translator</span> <span class="special">=</span> <span class="identifier">translator_type</span><span class="special">(),</span>
+ <span class="identifier">allocator_type</span> <span class="identifier">allocator</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">())</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.description">Description</a>
+ </h6>
+<p>
+ The constructor.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_iterator__iterator_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'first'
+ </p>
+ </td>
+<td>
+ <p>
+ The beginning of the range of Values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'last'
+ </p>
+ </td>
+<td>
+ <p>
+ The end of the range of Values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>parameters_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'parameters'
+ </p>
+ </td>
+<td>
+ <p>
+ The parameters object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>translator_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'translator'
+ </p>
+ </td>
+<td>
+ <p>
+ The translator object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>allocator_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'allocator'
+ </p>
+ </td>
+<td>
+ <p>
+ The allocator object.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___" title="rtree(Range const &amp;)">rtree(Range
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Range</span><span class="special">&gt;</span>
+<span class="identifier">rtree</span><span class="special">(</span><span class="identifier">Range</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rng</span><span class="special">,</span>
+ <span class="identifier">parameters_type</span> <span class="identifier">parameters</span> <span class="special">=</span> <span class="identifier">parameters_type</span><span class="special">(),</span>
+ <span class="identifier">translator_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">translator</span> <span class="special">=</span> <span class="identifier">translator_type</span><span class="special">(),</span>
+ <span class="identifier">allocator_type</span> <span class="identifier">allocator</span> <span class="special">=</span> <span class="identifier">allocator_type</span><span class="special">())</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.description">Description</a>
+ </h6>
+<p>
+ The constructor.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_range_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Range const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'rng'
+ </p>
+ </td>
+<td>
+ <p>
+ The range of Values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>parameters_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'parameters'
+ </p>
+ </td>
+<td>
+ <p>
+ The parameters object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>translator_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'translator'
+ </p>
+ </td>
+<td>
+ <p>
+ The translator object.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>allocator_type</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'allocator'
+ </p>
+ </td>
+<td>
+ <p>
+ The allocator object.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__" title="~rtree()">~rtree()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">rtree</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree._rtree__.description">Description</a>
+ </h6>
+<p>
+ The destructor.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___" title="rtree(rtree const &amp;)">rtree(rtree
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span><span class="special">(</span><span class="identifier">rtree</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">src</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.description">Description</a>
+ </h6>
+<p>
+ The copy constructor. It uses parameters, translator and allocator from
+ the source tree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>rtree const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'src'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be copied.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___" title="rtree(rtree const &amp;, allocator_type const &amp;)">rtree(rtree
+ const &amp;, allocator_type const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span><span class="special">(</span><span class="identifier">rtree</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">src</span><span class="special">,</span> <span class="identifier">allocator_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">allocator</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.description">Description</a>
+ </h6>
+<p>
+ The copy constructor. It uses Parameters and translator from the source
+ tree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree_const____allocator_type_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>rtree const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'src'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be copied.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>allocator_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'allocator'
+ </p>
+ </td>
+<td>
+ <p>
+ The allocator which will be used.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____" title="rtree(rtree &amp;&amp;)">rtree(rtree
+ &amp;&amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span><span class="special">(</span><span class="identifier">rtree</span> <span class="special">&amp;&amp;</span> <span class="identifier">src</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.description">Description</a>
+ </h6>
+<p>
+ The moving constructor. It uses parameters, translator and allocator
+ from the source tree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.rtree_rtree____.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>rtree &amp;&amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'src'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be moved.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___" title="operator=(const rtree &amp;)">operator=(const
+ rtree &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">rtree</span> <span class="special">&amp;</span> <span class="identifier">src</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.description">Description</a>
+ </h6>
+<p>
+ The assignment operator. It uses parameters and translator from the source
+ tree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__const_rtree___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>const rtree &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'src'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be copied.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____" title="operator=(rtree &amp;&amp;)">operator=(rtree
+ &amp;&amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">rtree</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">rtree</span> <span class="special">&amp;&amp;</span> <span class="identifier">src</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.description">Description</a>
+ </h6>
+<p>
+ The moving assignment. It uses parameters and translator from the source
+ tree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.operator__rtree____.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>rtree &amp;&amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'src'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be moved.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___" title="swap(rtree &amp;)">swap(rtree
+ &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">rtree</span> <span class="special">&amp;</span> <span class="identifier">other</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.description">Description</a>
+ </h6>
+<p>
+ Swaps contents of two rtrees. Parameters, translator and allocators are
+ swapped as well.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.swap_rtree___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>rtree &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'other'
+ </p>
+ </td>
+<td>
+ <p>
+ The rtree which content will be swapped with this rtree content.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___" title="insert(value_type const &amp;)">insert(value_type
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">insert</span><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">value</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.description">Description</a>
+ </h6>
+<p>
+ Insert a value to the index.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_value_type_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>value_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'value'
+ </p>
+ </td>
+<td>
+ <p>
+ The value which will be stored in the container.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_" title="insert(Iterator, Iterator)">insert(Iterator,
+ Iterator)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">insert</span><span class="special">(</span><span class="identifier">Iterator</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">last</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.description">Description</a>
+ </h6>
+<p>
+ Insert a range of values to the index.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_iterator__iterator_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'first'
+ </p>
+ </td>
+<td>
+ <p>
+ The beginning of the range of values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'last'
+ </p>
+ </td>
+<td>
+ <p>
+ The end of the range of values.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___" title="insert(Range const &amp;)">insert(Range
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Range</span><span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">insert</span><span class="special">(</span><span class="identifier">Range</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rng</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.description">Description</a>
+ </h6>
+<p>
+ Insert a range of values to the index.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.insert_range_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>Range const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'rng'
+ </p>
+ </td>
+<td>
+ <p>
+ The range of values.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___" title="remove(value_type const &amp;)">remove(value_type
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">size_type</span> <span class="identifier">remove</span><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">value</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.description">Description</a>
+ </h6>
+<p>
+ In contrast to the STL set/map erase() method this method removes only
+ one value from the container.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>value_type const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'value'
+ </p>
+ </td>
+<td>
+ <p>
+ The value which will be removed from the container.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_value_type_const___.returns">Returns</a>
+ </h6>
+<p>
+ 1 if the value was removed, 0 otherwise.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_" title="remove(Iterator, Iterator)">remove(Iterator,
+ Iterator)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">remove</span><span class="special">(</span><span class="identifier">Iterator</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">last</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.description">Description</a>
+ </h6>
+<p>
+ In contrast to the STL set/map erase() method it doesn't take iterators
+ pointing to values stored in this container. It removes values equal
+ to these passed as a range. Furthermore this method removes only one
+ value for each one passed in the range, not all equal values.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'first'
+ </p>
+ </td>
+<td>
+ <p>
+ The beginning of the range of values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Iterator</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'last'
+ </p>
+ </td>
+<td>
+ <p>
+ The end of the range of values.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_iterator__iterator_.returns">Returns</a>
+ </h6>
+<p>
+ The number of removed values.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___" title="remove(Range const &amp;)">remove(Range
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Range</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">remove</span><span class="special">(</span><span class="identifier">Range</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rng</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.description">Description</a>
+ </h6>
+<p>
+ In contrast to the STL set/map erase() method it removes values equal
+ to these passed as a range. Furthermore, this method removes only one
+ value for each one passed in the range, not all equal values.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>Range const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'rng'
+ </p>
+ </td>
+<td>
+ <p>
+ The range of values.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.remove_range_const___.returns">Returns</a>
+ </h6>
+<p>
+ The number of removed values.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_" title="spatial_query(Predicates const &amp;, OutIter)">spatial_query(Predicates
+ const &amp;, OutIter)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Predicates</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">OutIter</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">spatial_query</span><span class="special">(</span><span class="identifier">Predicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">pred</span><span class="special">,</span> <span class="identifier">OutIter</span> <span class="identifier">out_it</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.description">Description</a>
+ </h6>
+<p>
+ Spatial predicates may be a Geometry (in this case default predicate
+ - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry),
+ bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry),
+ !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry),
+ !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func).
+ Those predicates may be passed together in std::pair or boost::tuple.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Predicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'pred'
+ </p>
+ </td>
+<td>
+ <p>
+ The spatial predicates or a Geometry.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>OutIter</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'out_it'
+ </p>
+ </td>
+<td>
+ <p>
+ The output iterator of the result range. E.g. an iterator generated
+ by std::back_inserter(container)
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.spatial_query_predicates_const____outiter_.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___" title="nearest_query(DistancesPredicates const &amp;, value_type &amp;)">nearest_query(DistancesPredicates
+ const &amp;, value_type &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">DistancesPredicates</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">nearest_query</span><span class="special">(</span><span class="identifier">DistancesPredicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">dpred</span><span class="special">,</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <span class="identifier">v</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.description">Description</a>
+ </h6>
+<p>
+ The distances predicates may be a Point. This is default case where Value
+ which nearest point is closest to Point is returned. May be a PointRelation
+ which define how distance to Value is calculated. This may be generated
+ by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point).
+ DistancesPredicates may also define distances bounds. E.g. that some
+ distance must be between min_distance and max_distance. This may be generated
+ by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation,
+ MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation,
+ MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds
+ and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound)
+ or bgi::to_furthest(dist_bound).
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>DistancesPredicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'dpred'
+ </p>
+ </td>
+<td>
+ <p>
+ The distances predicates or a Point.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>value_type &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'v'
+ </p>
+ </td>
+<td>
+ <p>
+ The reference to the object which will contain the result.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____value_type___.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___" title="nearest_query(DistancesPredicates const &amp;, Predicates const &amp;, value_type &amp;)">nearest_query(DistancesPredicates
+ const &amp;, Predicates const &amp;, value_type &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">DistancesPredicates</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Predicates</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">nearest_query</span><span class="special">(</span><span class="identifier">DistancesPredicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">dpred</span><span class="special">,</span>
+ <span class="identifier">Predicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">pred</span><span class="special">,</span>
+ <span class="identifier">value_type</span> <span class="special">&amp;</span> <span class="identifier">v</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.description">Description</a>
+ </h6>
+<p>
+ The distances predicates may be a Point. This is default case where Value
+ which nearest point is closest to Point is returned. May be a PointRelation
+ which define how distance to Value is calculated. This may be generated
+ by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point).
+ DistancesPredicates may also define distances bounds. E.g. that some
+ distance must be between min_distance and max_distance. This may be generated
+ by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation,
+ MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation,
+ MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds
+ and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound)
+ or bgi::to_furthest(dist_bound).
+ </p>
+<p>
+ The spatial predicates. May be a Geometry (in this case default predicate
+ - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry),
+ bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry),
+ !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry),
+ !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func).
+ Those predicates may be passed together in std::pair or boost::tuple.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>DistancesPredicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'dpred'
+ </p>
+ </td>
+<td>
+ <p>
+ The distances predicates or a Point.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Predicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'pred'
+ </p>
+ </td>
+<td>
+ <p>
+ The spatial predicates or a Geometry
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>value_type &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'v'
+ </p>
+ </td>
+<td>
+ <p>
+ The reference to the object which will contain the result.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____predicates_const____value_type___.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_" title="nearest_query(DistancesPredicates const &amp;, size_t, OutIter)">nearest_query(DistancesPredicates
+ const &amp;, size_t, OutIter)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">DistancesPredicates</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">OutIter</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">nearest_query</span><span class="special">(</span><span class="identifier">DistancesPredicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">dpred</span><span class="special">,</span>
+ <span class="identifier">size_t</span> <span class="identifier">k</span><span class="special">,</span>
+ <span class="identifier">OutIter</span> <span class="identifier">out_it</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.description">Description</a>
+ </h6>
+<p>
+ The distances predicates. May be a Point. This is default case where
+ Value which nearest point is closest to Point is returned. May be a PointRelation
+ which define how distance to Value is calculated. This may be generated
+ by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point).
+ DistancesPredicates may also define distances bounds. E.g. that some
+ distance must be between min_distance and max_distance. This may be generated
+ by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation,
+ MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation,
+ MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds
+ and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound)
+ or bgi::to_furthest(dist_bound).
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>DistancesPredicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'dpred'
+ </p>
+ </td>
+<td>
+ <p>
+ The distances predicates or a Point.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>size_t</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'k'
+ </p>
+ </td>
+<td>
+ <p>
+ The max number of values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>OutIter</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'out_it'
+ </p>
+ </td>
+<td>
+ <p>
+ The output iterator of the result range. E.g. a back_insert_iterator.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__outiter_.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_" title="nearest_query(DistancesPredicates const &amp;, size_t, Predicates const &amp;, OutIter)">nearest_query(DistancesPredicates
+ const &amp;, size_t, Predicates const &amp;, OutIter)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">DistancesPredicates</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Predicates</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">OutIter</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">nearest_query</span><span class="special">(</span><span class="identifier">DistancesPredicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">dpred</span><span class="special">,</span>
+ <span class="identifier">size_t</span> <span class="identifier">k</span><span class="special">,</span>
+ <span class="identifier">Predicates</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">pred</span><span class="special">,</span>
+ <span class="identifier">OutIter</span> <span class="identifier">out_it</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.description">Description</a>
+ </h6>
+<p>
+ The distances predicates may be a Point. This is default case where Value
+ which nearest point is closest to Point is returned. May be a PointRelation
+ which define how distance to Value is calculated. This may be generated
+ by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point).
+ DistancesPredicates may also define distances bounds. E.g. that some
+ distance must be between min_distance and max_distance. This may be generated
+ by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation,
+ MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation,
+ MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds
+ and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound)
+ or bgi::to_furthest(dist_bound).
+ </p>
+<p>
+ The spatial predicates. May be a Geometry (in this case default predicate
+ - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry),
+ bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry),
+ !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry),
+ !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func).
+ Those predicates may be passed together in std::pair or boost::tuple.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>DistancesPredicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'dpred'
+ </p>
+ </td>
+<td>
+ <p>
+ The distances predicates or a Point
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>size_t</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'k'
+ </p>
+ </td>
+<td>
+ <p>
+ The max number of values.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>Predicates const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'pred'
+ </p>
+ </td>
+<td>
+ <p>
+ The spatial predicates or a Geometry.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="bold"><strong>OutIter</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'out_it'
+ </p>
+ </td>
+<td>
+ <p>
+ The output iterator of the result range. E.g. a back_insert_iterator.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.nearest_query_distancespredicates_const____size_t__predicates_const____outiter_.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.size__" title="size()">size()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.size__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.size__.description">Description</a>
+ </h6>
+<p>
+ Returns the number of stored values.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.size__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.size__.returns">Returns</a>
+ </h6>
+<p>
+ The number of stored values.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.empty__" title="empty()">empty()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.description">Description</a>
+ </h6>
+<p>
+ Query if the container is empty.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.empty__.returns">Returns</a>
+ </h6>
+<p>
+ true if the container is empty.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.clear__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.clear__" title="clear()">clear()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">clear</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.clear__.description">Description</a>
+ </h6>
+<p>
+ Removes all values stored in the container.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.box__" title="box()">box()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.box__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">box_type</span> <span class="identifier">box</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.box__.description">Description</a>
+ </h6>
+<p>
+ Returns the box containing all values stored in the container. If the
+ container is empty the result of geometry::assign_inverse() is returned.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.box__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.box__.returns">Returns</a>
+ </h6>
+<p>
+ The box containing all values stored in the container or an invalid box
+ if there are no values in the container.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___" title="count(ValueOrIndexable const &amp;)">count(ValueOrIndexable
+ const &amp;)</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">ValueOrIndexable</span><span class="special">&gt;</span>
+<span class="identifier">size_type</span> <span class="identifier">count</span><span class="special">(</span><span class="identifier">ValueOrIndexable</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">vori</span><span class="special">)</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.description">Description</a>
+ </h6>
+<p>
+ For indexable_type it returns the number of values which indexables equals
+ the parameter. For value_type it returns the number of values which equals
+ the parameter.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.parameters"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.parameters">Parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Type
+ </p>
+ </th>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <span class="bold"><strong>ValueOrIndexable const &amp;</strong></span>
+ </p>
+ </td>
+<td>
+ <p>
+ 'vori'
+ </p>
+ </td>
+<td>
+ <p>
+ The value or indexable which will be counted.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.h3"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.count_valueorindexable_const___.returns">Returns</a>
+ </h6>
+<p>
+ The number of values found.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__" title="parameters()">parameters()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">parameters_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">parameters</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.description">Description</a>
+ </h6>
+<p>
+ Returns parameters.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.parameters__.returns">Returns</a>
+ </h6>
+<p>
+ The parameters object.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.translator__" title="translator()">translator()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">translator_type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">translator</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.description">Description</a>
+ </h6>
+<p>
+ Returns the translator object.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.translator__.returns">Returns</a>
+ </h6>
+<p>
+ The translator object.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__"></a><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__" title="get_allocator()">get_allocator()</a>
+</h5></div></div></div>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.h0"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.synopsis"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.synopsis">Synopsis</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">allocator_type</span> <span class="identifier">get_allocator</span><span class="special">()</span></pre>
+<p>
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.h1"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.description"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.description">Description</a>
+ </h6>
+<p>
+ Returns allocator used by the rtree.
+ </p>
+<h6>
+<a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.h2"></a>
+ <span class="phrase"><a name="geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.returns"></a></span><a class="link" href="index.html#geometry_index.r_tree.index.boost_geometry_index_rtree.get_allocator__.returns">Returns</a>
+ </h6>
+<p>
+ The allocator.
+ </p>
+</div>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox-branches/geometry/index/doc/html/index.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/index.html (original)
+++ sandbox-branches/geometry/index/doc/html/index.html 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -57,7 +57,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: January 07, 2013 at 21:06:41 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 07, 2013 at 23:08:40 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/Jamfile.v2 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,30 @@
+# Boost.Geometry (aka GGL, Generic Geometry Library)
+# Doxygen XML to QuickBook
+#
+# Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+# Copyright (c) 2010-2012 Mateusz Loskot, London, UK.
+
+# Use, modification and distribution is subject to the Boost Software License,
+# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+
+project doxygen_xml2qbk
+ : requirements
+ <include>.
+ <include>contrib/rapidxml-1.13
+ <library>../../../../../libs/program_options/build//boost_program_options
+ <link>static
+ ;
+
+exe doxygen_xml2qbk : doxygen_xml2qbk.cpp ;
+
+install dist-bin
+ :
+ doxygen_xml2qbk
+ :
+ <install-type>EXE
+ <location>../../../../../dist/bin
+ :
+ release
+ ;

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/configuration.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/configuration.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,33 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef CONFIGURATION_HPP
+#define CONFIGURATION_HPP
+
+
+#include <string>
+#include <vector>
+
+
+struct configuration
+{
+ // To transfer e.g. c:/_svn/boost/trunk/boost/geometry/algorithms/area.hpp
+ // to #include <boost/geometry/...>
+ // We need to find the position where the include path should start,
+ // so fill out "boost" here, or "boost/geometry" (it uses rfind)
+ std::string start_include;
+
+ // Convenience headers (headefiles with solely purpose of including others
+ std::string convenience_header_path;
+ std::vector<std::string> convenience_headers;
+
+ std::string skip_namespace;
+};
+
+
+#endif // CONFIGURATION_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/license.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/license.txt 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,52 @@
+Use of this software is granted under one of the following two licenses,
+to be chosen freely by the user.
+
+1. Boost Software License - Version 1.0 - August 17th, 2003
+===============================================================================
+
+Copyright (c) 2006, 2007 Marcin Kalicinski
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+2. The MIT License
+===============================================================================
+
+Copyright (c) 2006, 2007 Marcin Kalicinski
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/manual.html
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/manual.html 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,406 @@
+<html><head><style type="text/css">
+
+ body
+ {
+ font-family: sans-serif;
+ font-size: 90%;
+ margin: 8pt 8pt 8pt 8pt;
+ text-align: justify;
+ background-color: White;
+ }
+
+ h1 { font-weight: bold; text-align: left; }
+ h2 { font: 140% sans-serif; font-weight: bold; text-align: left; }
+ h3 { font: 120% sans-serif; font-weight: bold; text-align: left; }
+ h4 { font: bold 100% sans-serif; font-weight: bold; text-align: left; }
+ h5 { font: italic 100% sans-serif; font-weight: bold; text-align: left; }
+ h6 { font: small-caps 100% sans-serif; font-weight: bold; text-align: left; }
+
+ code
+ {
+ font-family: &quot;Courier New&quot;, Courier, mono;
+ }
+
+ pre
+ {
+ border-top: gray 0.5pt solid;
+ border-right: gray 0.5pt solid;
+ border-left: gray 0.5pt solid;
+ border-bottom: gray 0.5pt solid;
+ padding-top: 2pt;
+ padding-right: 2pt;
+ padding-left: 2pt;
+ padding-bottom: 2pt;
+ display: block;
+ font-family: &quot;courier new&quot;, courier, mono;
+ background-color: #eeeeee;
+ }
+
+ a
+ {
+ color: #000080;
+ text-decoration: none;
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+ .reference-header
+ {
+ border-top: gray 0.5pt solid;
+ border-right: gray 0.5pt solid;
+ border-left: gray 0.5pt solid;
+ border-bottom: gray 0.5pt solid;
+ padding-top: 2pt;
+ padding-right: 2pt;
+ padding-left: 2pt;
+ padding-bottom: 2pt;
+ background-color: #dedede;
+ }
+
+ .parameter-name
+ {
+ font-style: italic;
+ }
+
+ .indented
+ {
+ margin-left: 0.5cm;
+ }
+
+ a.toc1
+ {
+ margin-left: 0.0cm;
+ }
+
+ a.toc2
+ {
+ margin-left: 0.75cm;
+ }
+
+ a.toc3
+ {
+ margin-left: 1.5cm;
+ }
+
+ </style></head><body><h1>RAPIDXML Manual</h1><h3>Version 1.13</h3><detaileddescription xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><para><i>Copyright (C) 2006, 2009 Marcin Kalicinski</i><br/><i>See accompanying file license.txt for license information.</i><hr/><h2 level="2">Table of Contents</h2></para><para><toc><toc-contents>1. What is RapidXml?<br/>1.1 Dependencies And Compatibility<br/>1.2 Character Types And Encodings<br/>1.3 Error Handling<br/>1.4 Memory Allocation<br/>1.5 W3C Compliance<br/><a href="#namespacerapidxml_1api_design" class="toc2">1.6 API Desig
n</a><br/>1.7 Reliability<br/>1.8 Acknowledgements<br/>2. Two Minute Tutorial<br/>2.1 Parsing<br/>2.2 Accessing The DOM Tree<br/>2.3 Modifying The DOM Tree<br/>2.4 Printing XML<br/>3. Differences From Regular XML Parsers<br/>3.1 Lifetime Of Source Text<br/>3.2 Ownership Of Strings<br/><a href="#namespacerapidxml_1destructive_non_destructive" class="toc2">3.3 Destructive Vs Non-Destructive
Mode</a><br/>4. Performance<br/>4.1 Comparison With Other Parsers<br/>5. Reference<br/></toc-contents></toc><br/></para><sect1><h2 id="namespacerapidxml_1what_is_rapidxml">1. What is RapidXml?</h2><para>RapidXml is an attempt to create the fastest XML DOM parser possible, while retaining useability, portability and reasonable W3C compatibility. It is an in-situ parser written in C++, with parsing speed approaching that of <code>strlen()</code> function executed on the same data. <br/><br/>
+ Entire parser is contained in a single header file, so no building or linking is neccesary. To use it you just need to copy <code>rapidxml.hpp</code> file to a convenient place (such as your project directory), and include it where needed. You may also want to use printing functions contained in header <code>rapidxml_print.hpp</code>.</para><sect2><h3 id="namespacerapidxml_1dependencies_and_compatibility">1.1 Dependencies And Compatibility</h3><para>RapidXml has <i>no dependencies</i> other than a very small subset of standard C++ library (<code>&lt;cassert&gt;</code>, <code>&lt;cstdlib&gt;</code>, <code>&lt;new&gt;</code> and <code>&lt;exception&gt;</code>, unless exceptions are disabled). It should compile on any reasonably conformant compiler, and was tested on Visual C++ 2003, Visual C++ 2005, Visual C++ 2008, gcc 3, gcc 4, and Comeau 4.3.3. Care was taken that no warnings are produced on these compilers, even with highest warning levels enabled.</para></sect2><sect2><h3 id="namespacerapidxml_1characte
r_types_and_encodings">1.2 Character Types And Encodings</h3><para>RapidXml is character type agnostic, and can work both with narrow and wide characters. Current version does not fully support UTF-16 or UTF-32, so use of wide characters is somewhat incapacitated. However, it should succesfully parse <code>wchar_t</code> strings containing UTF-16 or UTF-32 if endianness of the data matches that of the machine. UTF-8 is fully supported, including all numeric character references, which are expanded into appropriate UTF-8 byte sequences (unless you enable parse_no_utf8 flag). <br/><br/>
+ Note that RapidXml performs no decoding - strings returned by name() and value() functions will contain text encoded using the same encoding as source file. Rapidxml understands and expands the following character references: <code>&amp;apos; &amp;amp; &amp;quot; &amp;lt; &amp;gt; &amp;#...;</code> Other character references are not expanded.</para></sect2><sect2><h3 id="namespacerapidxml_1error_handling">1.3 Error Handling</h3><para>By default, RapidXml uses C++ exceptions to report errors. If this behaviour is undesirable, RAPIDXML_NO_EXCEPTIONS can be defined to suppress exception code. See parse_error class and parse_error_handler() function for more information.</para></sect2><sect2><h3 id="namespacerapidxml_1memory_allocation">1.4 Memory Allocation</h3><para>RapidXml uses a special memory pool object to allocate nodes and
attributes, because direct allocation using <code>new</code> operator would be far too slow. Underlying memory allocations performed by the pool can be customized by use of memory_pool::set_allocator() function. See class memory_pool for more information.</para></sect2><sect2><h3 id="namespacerapidxml_1w3c_compliance">1.5 W3C Compliance</h3><para>RapidXml is not a W3C compliant parser, primarily because it ignores DOCTYPE declarations. There is a number of other, minor incompatibilities as well. Still, it can successfully parse and produce complete trees of all valid XML files in W3C conformance suite (over 1000 files specially designed to find flaws in XML processors). In destructive mode it performs whitespace normalization and character entity substitution for a small set of built-in entities.</para></sect2><sect2><
h3 id="namespacerapidxml_1api_design">1.6 API Design</h3><para>RapidXml API is minimalistic, to reduce code size as much as possible, and facilitate use in embedded environments. Additional convenience functions are provided in separate headers: <code>rapidxml_utils.hpp</code> and <code>rapidxml_print.hpp</code>. Contents of these headers is not an essential part of the library, and is currently not documented (otherwise than with comments in code).</para></sect2><sect2><h3 id="namespacerapidxml_1reliability">1.7 Reliability</h3><para>RapidXml is very robust and comes with a large harness of unit tests. Special care has been taken to ensure stability of the parser no matter what source text is thrown at it. One of the unit tests produces 100,000 randomly corrupted variants of XML document, which (when uncorrupted) contains all constructs recognized by RapidXml. RapidXml passes this test when it correctly recognizes that errors have been introduced, and d
oes not crash or loop indefinitely. <br/><br/>
+ Another unit test puts RapidXml head-to-head with another, well estabilished XML parser, and verifies that their outputs match across a wide variety of small and large documents. <br/><br/>
+ Yet another test feeds RapidXml with over 1000 test files from W3C compliance suite, and verifies that correct results are obtained. There are also additional tests that verify each API function separately, and test that various parsing modes work as expected.</para></sect2><sect2><h3 id="namespacerapidxml_1acknowledgements">1.8 Acknowledgements</h3><para>I would like to thank Arseny Kapoulkine for his work on pugixml, which was an inspiration for this project. Additional thanks go to Kristen Wegner for creating pugxml, from which pugixml was derived. Janusz Wohlfeil kindly ran RapidXml speed tests on hardware that I did not have access to, allowing me to expand performance comparison table.</para></sect2></sect1><sect1><h2 id="namespacerapidxml_1two_minute_tutorial">2. Two Minute Tutorial</h2><sect2><h3 id="namespacerapidxml_1parsing">2.1 Parsing</h3><para>The following code causes RapidXml to parse a z
ero-terminated string named <code>text</code>: <pre>using namespace rapidxml;
+xml_document&lt;&gt; doc; // character type defaults to char
+doc.parse&lt;0&gt;(text); // 0 means default parse flags
+</pre><code>doc</code> object is now a root of DOM tree containing representation of the parsed XML. Because all RapidXml interface is contained inside namespace <code>rapidxml</code>, users must either bring contents of this namespace into scope, or fully qualify all the names. Class xml_document represents a root of the DOM hierarchy. By means of public inheritance, it is also an xml_node and a memory_pool. Template parameter of xml_document::parse() function is used to specify parsing flags, with which you can fine-tune behaviour of the parser. Note that flags must be a compile-time constant.</para></sect2><sect2><h3 id="namespacerapidxml_1accessing_dom_tree">2.2 Accessing The DOM Tree</h3>
<para>To access the DOM tree, use methods of xml_node and xml_attribute classes: <pre>cout &lt;&lt; &quot;Name of my first node is: &quot; &lt;&lt; doc.first_node()-&gt;name() &lt;&lt; &quot;\n&quot;;
+xml_node&lt;&gt; *node = doc.first_node(&quot;foobar&quot;);
+cout &lt;&lt; &quot;Node foobar has value &quot; &lt;&lt; node-&gt;value() &lt;&lt; &quot;\n&quot;;
+for (xml_attribute&lt;&gt; *attr = node-&gt;first_attribute();
+ attr; attr = attr-&gt;next_attribute())
+{
+ cout &lt;&lt; &quot;Node foobar has attribute &quot; &lt;&lt; attr-&gt;name() &lt;&lt; &quot; &quot;;
+ cout &lt;&lt; &quot;with value &quot; &lt;&lt; attr-&gt;value() &lt;&lt; &quot;\n&quot;;
+}
+</pre></para></sect2><sect2><h3 id="namespacerapidxml_1modifying_dom_tree">2.3 Modifying The DOM Tree</h3><para>DOM tree produced by the parser is fully modifiable. Nodes and attributes can be added/removed, and their contents changed. The below example creates a HTML document, whose sole contents is a link to google.com website: <pre>xml_document&lt;&gt; doc;
+xml_node&lt;&gt; *node = doc.allocate_node(node_element, &quot;a&quot;, &quot;Google&quot;);
+doc.append_node(node);
+xml_attribute&lt;&gt; *attr = doc.allocate_attribute(&quot;href&quot;, &quot;google.com&quot;);
+node-&gt;append_attribute(attr);
+</pre> One quirk is that nodes and attributes <i>do not own</i> the text of their names and values. This is because normally they only store pointers to the source text. So, when assigning a new name or value to the node, care must be taken to ensure proper lifetime of the string. The easiest way to achieve it is to allocate the string from the xml_document memory pool. In the above example this is not necessary, because we are only assigning character constants. But the code below uses memory_pool::allocate_string() function to allocate node name (which will have the same lifetime as the document), and assigns it to a new node: <pre>xml_document&lt;&gt; doc;
+char *node_name = doc.allocate_string(name); // Allocate string and copy name into it
+xml_node&lt;&gt; *node = doc.allocate_node(node_element, node_name); // Set node name to node_name
+</pre> Check Reference section for description of the entire interface.</para></sect2><sect2><h3 id="namespacerapidxml_1printing">2.4 Printing XML</h3><para>You can print <code>xml_document</code> and <code>xml_node</code> objects into an XML string. Use print() function or operator &lt;&lt;, which are defined in <code>rapidxml_print.hpp</code> header. <pre>using namespace rapidxml;
+xml_document&lt;&gt; doc; // character type defaults to char
+// ... some code to fill the document
+
+// Print to stream using operator &lt;&lt;
+std::cout &lt;&lt; doc;
+
+// Print to stream using print function, specifying printing flags
+print(std::cout, doc, 0); // 0 means default printing flags
+
+// Print to string using output iterator
+std::string s;
+print(std::back_inserter(s), doc, 0);
+
+// Print to memory buffer using output iterator
+char buffer[4096]; // You are responsible for making the buffer large enough!
+char *end = print(buffer, doc, 0); // end contains pointer to character after last printed character
+*end = 0; // Add string terminator after XML
+</pre></para></sect2></sect1><sect1><h2 id="namespacerapidxml_1differences">3. Differences From Regular XML Parsers</h2><para>RapidXml is an <i>in-situ parser</i>, which allows it to achieve very high parsing speed. In-situ means that parser does not make copies of strings. Instead, it places pointers to the <i>source text</i> in the DOM hierarchy.</para><sect2><h3 id="namespacerapidxml_1lifetime_of_source_text">3.1 Lifetime Of Source Text</h3><para>In-situ parsing requires that source text lives at least as long as the document object. If source text is destroyed, names and values of nodes in DOM tree will become destroyed as well. Additionally, whitespace processing, character entity translation, and zero-termination of strings require that source text be modified during parsing (but see non-destructive mode). This makes the text useless for further processing once it was parsed by RapidXml. <br/><br/>
+ In many cases however, these are not serious issues.</para></sect2><sect2><h3 id="namespacerapidxml_1ownership_of_strings">3.2 Ownership Of Strings</h3><para>Nodes and attributes produced by RapidXml do not own their name and value strings. They merely hold the pointers to them. This means you have to be careful when setting these values manually, by using xml_base::name(const Ch *) or xml_base::value(const Ch *) functions. Care must be taken to ensure that lifetime of the string passed is at least as long as lifetime of the node/attribute. The easiest way to achieve it is to allocate the string from memory_pool owned by the document. Use <a href="#classrapidxml_1_1memory__pool_69729185bc59b08751
92d667c47b8859_169729185bc59b0875192d667c47b8859" kindref="member">memory_pool::allocate_string()</a> function for this purpose.</para></sect2><sect2><h3 id="namespacerapidxml_1destructive_non_destructive">3.3 Destructive Vs Non-Destructive Mode</h3><para>By default, the parser modifies source text during the parsing process. This is required to achieve character entity translation, whitespace normalization, and zero-termination of strings. <br/><br/>
+ In some cases this behaviour may be undesirable, for example if source text resides in read only memory, or is mapped to memory directly from file. By using appropriate parser flags (parse_non_destructive), source text modifications can be disabled. However, because RapidXml does in-situ parsing, it obviously has the following side-effects:<ul><li><para>no whitespace normalization is done</para></li><li><para>no entity reference translation is done</para></li><li><para>names and values are not zero-terminated, you must use xml_base::name_size() and xml_base::value_size() functions to tell where they end</para></li></ul></para></sect2></sect1><sect1><h2 id="namespacerapidxml_1performance">4. Performance</h2><para>RapidXml achieves its speed through use of seve
ral techniques:<ul><li><para>In-situ parsing. When building DOM tree, RapidXml does not make copies of string data, such as node names and values. Instead, it stores pointers to interior of the source text.</para></li><li><para>Use of template metaprogramming techniques. This allows it to move much of the work to compile time. Through magic of the templates, C++ compiler generates a separate copy of parsing code for any combination of parser flags you use. In each copy, all possible decisions are made at compile time and all unused code is omitted.</para></li><li><para>Extensive use of lookup tables for parsing.</para></li><li><para>Hand-tuned C++ with profiling done on several most popular CPUs.</para></li></ul></para><para>This results in a very small and fast code: a parser which is custom tailored to exact needs with each invocation.</para><sect2><h3 id="namespacerapidxml_1performance_charts">4.1 Comparison With Other Parsers</h3><para>The table below compares speed of RapidXml to some other parsers, and
 to <code>strlen()</code> function executed on the same data. On a modern CPU (as of 2007), you can expect parsing throughput to be close to 1 GB/s. As a rule of thumb, parsing speed is about 50-100x faster than Xerces DOM, 30-60x faster than TinyXml, 3-12x faster than pugxml, and about 5% - 30% faster than pugixml, the fastest XML parser I know of.</para><para><ul><li><para>The test file is a real-world, 50kB large, moderately dense XML file. </para></li><li><para>All timing is done by using RDTSC instruction present in Pentium-compatible CPUs. </para></li><li><para>No profile-guided optimizations are used. </para></li><li><para>All parsers are running in their fastest modes. </para></li><li><para>The results are given in CPU cycles per character, so frequency of CPUs is irrelevant. </para></li><li><para>The results are minimum values from a large number of runs, to minimize effects of operating system activity, task switching, interrupt handling etc. </para></li><li><para>A single parse of the test file ta
kes about 1/10th of a millisecond, so with large number of runs there is a good chance of hitting at least one no-interrupt streak, and obtaining undisturbed results. </para></li></ul><table rows="9" cols="7" border="1" cellpadding="3pt"><tr><th thead="yes"><para><center>Platform</center></para></th><th thead="yes"><para><center>Compiler</center></para></th><th thead="yes"><para>strlen() </para></th><th thead="yes"><para>RapidXml </para></th><th thead="yes"><para>pugixml 0.3 </para></th><th thead="yes"><para>pugxml </para></th><th thead="yes"><para>TinyXml </para></th></tr><tr><td thead="no"><para><center>Pentium 4</center></para></td><td thead="no"><para><center>MSVC 8.0</center></para></td><td thead="no"><para><center>2.5</center></para></td><td thead="no"><para><center>5.4</center></para></td><td thead="no"><para><center>7.0</center></para></td><td thead="no"><para><center>61.7</center></para></td><td thead="no"><para><center>298.8</center></para></td></tr><tr><td thead="no"><para><center>Pentium 4</cent
er></para></td><td thead="no"><para><center>gcc 4.1.1</center></para></td><td thead="no"><para><center>0.8</center></para></td><td thead="no"><para><center>6.1</center></para></td><td thead="no"><para><center>9.5</center></para></td><td thead="no"><para><center>67.0</center></para></td><td thead="no"><para><center>413.2</center></para></td></tr><tr><td thead="no"><para><center>Core 2</center></para></td><td thead="no"><para><center>MSVC 8.0</center></para></td><td thead="no"><para><center>1.0</center></para></td><td thead="no"><para><center>4.5</center></para></td><td thead="no"><para><center>5.0</center></para></td><td thead="no"><para><center>24.6</center></para></td><td thead="no"><para><center>154.8</center></para></td></tr><tr><td thead="no"><para><center>Core 2</center></para></td><td thead="no"><para><center>gcc 4.1.1</center></para></td><td thead="no"><para><center>0.6</center></para></td><td thead="no"><para><center>4.6</center></para></td><td thead="no"><para><center>5.4</center></para></td><td the
ad="no"><para><center>28.3</center></para></td><td thead="no"><para><center>229.3</center></para></td></tr><tr><td thead="no"><para><center>Athlon XP</center></para></td><td thead="no"><para><center>MSVC 8.0</center></para></td><td thead="no"><para><center>3.1</center></para></td><td thead="no"><para><center>7.7</center></para></td><td thead="no"><para><center>8.0</center></para></td><td thead="no"><para><center>25.5</center></para></td><td thead="no"><para><center>182.6</center></para></td></tr><tr><td thead="no"><para><center>Athlon XP</center></para></td><td thead="no"><para><center>gcc 4.1.1</center></para></td><td thead="no"><para><center>0.9</center></para></td><td thead="no"><para><center>8.2</center></para></td><td thead="no"><para><center>9.2</center></para></td><td thead="no"><para><center>33.7</center></para></td><td thead="no"><para><center>265.2</center></para></td></tr><tr><td thead="no"><para><center>Pentium 3</center></para></td><td thead="no"><para><center>MSVC 8.0</center></para></td><td th
ead="no"><para><center>2.0</center></para></td><td thead="no"><para><center>6.3</center></para></td><td thead="no"><para><center>7.0</center></para></td><td thead="no"><para><center>30.9</center></para></td><td thead="no"><para><center>211.9</center></para></td></tr><tr><td thead="no"><para><center>Pentium 3</center></para></td><td thead="no"><para><center>gcc 4.1.1</center></para></td><td thead="no"><para><center>1.0</center></para></td><td thead="no"><para><center>6.7</center></para></td><td thead="no"><para><center>8.9</center></para></td><td thead="no"><para><center>35.3</center></para></td><td thead="no"><para><center>316.0</center></para></td></tr></table><i>(*) All results are in CPU cycles per character of source text</i></para></sect2></sect1><sect1><h2 id="namespacerapidxml_1reference">5. Reference</h2><para>This section lists all classes, functions, constants etc. and describes them in detail. </para></sect1></detaileddescription><dl><dt>class
+ template
+ rapidxml::memory_pool</dt><dt class="indented">
+ constructor
+ memory_pool()</dt><dt class="indented">
+ destructor
+ ~memory_pool()</dt><dt class="indented">function allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)</dt><dt class="indented">function allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0)</dt><dt class="indented">function allocate_string(const Ch *source=0, std::size_t size=0)</dt><dt class="indented">function <a href="#classrapidxml_1_1memory__pool_95c49fcb056e9103ec906a59e3e01d76_195c49fcb056e9103ec906a59e3e01d76">clone_node(const xml_node&lt;
Ch &gt; *source, xml_node&lt; Ch &gt; *result=0)</a></dt><dt class="indented">function clear()</dt><dt class="indented">function set_allocator(alloc_func *af, free_func *ff)</dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><p/><p/><dt>class rapidxml::parse_error</dt><dt class="indented">
+ constructor
+ parse_error(const char *what, void *where)</dt><dt class="indented">function what() const </dt><dt class="indented">function where() const </dt><dt class="indented"/><dt class="indented"/><p/><dt>class
+ template
+ rapidxml::xml_attribute</dt><dt class="indented">
+ constructor
+ xml_attribute()</dt><dt class="indented">function document() const </dt><dt class="indented">function previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><p/><dt>class
+ template
+ rapidxml::xml_base</dt><dt class="indented">
+ constructor
+ xml_base()</dt><dt class="indented">function name() const </dt><dt class="indented">function name_size() const </dt><dt class="indented">function value() const </dt><dt class="indented">function value_size() const </dt><dt class="indented">function name(const Ch *name, std::size_t size)</dt><dt class="indented">function <a href="#classrapidxml_1_1xml__base_e099c
291e104a0d277307fe71f5e0f9e_1e099c291e104a0d277307fe71f5e0f9e">name(const Ch *name)</a></dt><dt class="indented">function value(const Ch *value, std::size_t size)</dt><dt class="indented">function value(const Ch *value)</dt><dt class="indented">function parent() const </dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><p/><dt>class
+ template
+ rapidxml::xml_document</dt><dt class="indented">
+ constructor
+ xml_document()</dt><dt class="indented">function parse(Ch *text)</dt><dt class="indented">function clear()</dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><p/><p/><p/><p/><p/><p/><p/><p/><p/><dt>class
+ template
+ rapidxml::xml_node</dt><dt class="indented">
+ constructor
+ xml_node(node_type type)</dt><dt class="indented">function type() const </dt><dt class="indented">function document() const </dt><dt class="indented">function first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function <a href="#classrapidxml_1_1xml__node_ac2f6886c0107e9d5f156e9542546df6_1ac
2f6886c0107e9d5f156e9542546df6">previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </a></dt><dt class="indented">function next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const </dt><dt class="indented">function type(node_type type)</dt><dt class="indented">func
tion prepend_node(xml_node< Ch > *child)</dt><dt class="indented">function append_node(xml_node< Ch > *child)</dt><dt class="indented">function insert_node(xml_node< Ch > *where, xml_node< Ch > *child)</dt><dt class="indented">function remove_first_node()</dt><dt class="indented">function remove_last_node()</dt><dt class="indented">function <a href="#classrapidxml_1_1xml__node_9316463a2201631e7e2062b17729f9cd_19316463a2201631e7e2062b17729f9cd">remove
_node(xml_node&lt; Ch &gt; *where)</a></dt><dt class="indented">function remove_all_nodes()</dt><dt class="indented">function prepend_attribute(xml_attribute< Ch > *attribute)</dt><dt class="indented">function append_attribute(xml_attribute< Ch > *attribute)</dt><dt class="indented">function insert_attribute(xml_attribute< Ch > *where, xml_attribute< Ch > *attribute)</dt><dt class="indented">function remove_first_attribute()</dt><dt class="indented">
function remove_last_attribute()</dt><dt class="indented">function remove_attribute(xml_attribute< Ch > *where)</dt><dt class="indented">function remove_all_attributes()</dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><p/><dt>namespace rapidxml</dt><dt class="indented">enum node_type</dt><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented"/><dt
class="indented"/><dt class="indented"/><dt class="indented"/><dt class="indented">function parse_error_handler(const char *what, void *where)</dt><dt class="indented">function print(OutIt out, const xml_node< Ch > &node, int flags=0)</dt><dt class="indented">function print(std::basic_ostream< Ch > &out, const xml_node< Ch > &node, int flags=0)</dt><dt class="indented">function operator<<(std::basic_ostream< Ch > &out, const xml_node< Ch > &node)</dt><dt class="indented">
+ constant
+ parse_no_data_nodes</dt><dt class="indented">
+ constant
+ parse_no_element_values</dt><dt class="indented">
+ constant
+ parse_no_string_terminators</dt><dt class="indented">
+ constant
+ parse_no_entity_translation</dt><dt class="indented">
+ constant
+ parse_no_utf8</dt><dt class="indented">
+ constant
+ parse_declaration_node</dt><dt class="indented">
+ constant
+ parse_comment_nodes</dt><dt class="indented">
+ constant
+ parse_doctype_node</dt><dt class="indented">
+ constant
+ parse_pi_nodes</dt><dt class="indented">
+ constant
+ parse_validate_closing_tags</dt><dt class="indented">
+ constant
+ parse_trim_whitespace</dt><dt class="indented">
+ constant
+ parse_normalize_whitespace</dt><dt class="indented">
+ constant
+ parse_default</dt><dt class="indented">
+ constant
+ parse_non_destructive</dt><dt class="indented">
+ constant
+ parse_fastest</dt><dt class="indented">
+ constant
+ parse_full</dt><dt class="indented">
+ constant
+ print_no_indenting</dt><p/><p/><p/><p/></dl><hr/><h3 class="reference-header" id="classrapidxml_1_1memory__pool">class
+ template
+ rapidxml::memory_pool</h3>
+
+ Defined in rapidxml.hpp<br/>
+ Base class for
+ xml_document <h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. In most cases, you will not need to use this class directly. However, if you need to create nodes manually or modify names/values of nodes, you are encouraged to use memory_pool of relevant xml_document to allocate the memory. Not only is this faster than allocating them by using <code>new</code> operator, but also their lifetime will be tied to the lifetime of document, possibly simplyfing memory management. <br/><br/>
+ Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. You can also call allocate_string() function to allocate strings. Such strings can then be used as names or values of nodes without worrying about their lifetime. Note that there is no <code>free()</code> function -- all allocations are freed at once when clear() function is called, or when the pool is destroyed. <br/><br/>
+ It is also possible to create a standalone memory_pool, and use it to allocate nodes, whose lifetime will not be tied to any document. <br/><br/>
+ Pool maintains <code>RAPIDXML_STATIC_POOL_SIZE</code> bytes of statically allocated memory. Until static memory is exhausted, no dynamic memory allocations are done. When static memory is exhausted, pool allocates additional blocks of memory of size <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> each, by using global <code>new[]</code> and <code>delete[]</code> operators. This behaviour can be changed by setting custom allocation routines. Use set_allocator() function to set them. <br/><br/>
+ Allocations for nodes, attributes and strings are aligned at <code>RAPIDXML_ALIGNMENT</code> bytes. This value defaults to the size of pointer on target architecture. <br/><br/>
+ To obtain absolutely top performance from the parser, it is important that all nodes are allocated from a single, contiguous block of memory. Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. If required, you can tweak <code>RAPIDXML_STATIC_POOL_SIZE</code>, <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> and <code>RAPIDXML_ALIGNMENT</code> to obtain best wasted memory to performance compromise. To do it, define their values before rapidxml.hpp file is included. </para><h4>Parameters</h4><dl><dt class="parameter-name">Ch</dt><dd>Character type of created nodes. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_f8fb3c8f1a564f8045c40bcd07a89866_1f8fb3c8f1a564f8045c40bcd07a89866">
+ constructor
+ memory_pool::memory_pool</h3><h4>Synopsis</h4><code class="synopsis">memory_pool();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Constructs empty pool with default allocator functions. </para><p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_6f8c7990d9ec1ed2acf6558b238570eb_16f8c7990d9ec1ed2acf6558b238570eb">
+ destructor
+ memory_pool::~memory_pool</h3><h4>Synopsis</h4><code class="synopsis">~memory_pool();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Destroys pool and frees all the memory. This causes memory occupied by nodes allocated by the pool to be freed. Nodes allocated from the pool are no longer valid. </para><p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_750ba3c610b129ac057d817509d08f41_1750ba3c610b129ac057d817509d08f41">function memory_pool::allocate_node</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* allocate_node(node_type type, const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Allocates a new node from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function. </para><h4>Parameters</h4><dl><dt class="parameter-name">type</dt><dd class="parameter-def">Type of node to create. </dd></dl><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name to assign to the node, or 0 to assign no name. </dd></dl><dl><dt class="parameter-name">value</dt><dd class="parameter-def">Value to assign to the node, or 0 to assign no value. </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name to assign, or 0 to automa
tically calculate size from name string. </dd></dl><dl><dt class="parameter-name">value_size</dt><dd class="parameter-def">Size of value to assign, or 0 to automatically calculate size from value string. </dd></dl><h4>Returns</h4>Pointer to allocated node. This pointer will never be NULL. <p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_462de142669e0ff649e8e615b82bf457_1462de142669e0ff649e8e615b82bf457">function memory_pool::allocate_attribute</h3><h4>Synopsis</h4><code class="synopsis">xml_attribute&lt;Ch&gt;* allocate_attribute(const Ch *name=0, const Ch *value=0, std::size_t name_size=0, std::size_t value_size=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Allocates a new attribute from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name to assign to the attribute, or 0 to assign no name. </dd></dl><dl><dt class="parameter-name">value</dt><dd class="parameter-def">Value to assign to the attribute, or 0 to assign no value. </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name to assign, or 0 to automatically calculate size from name string. </dd></dl><dl><dt class="parameter-name">val
ue_size</dt><dd class="parameter-def">Size of value to assign, or 0 to automatically calculate size from value string. </dd></dl><h4>Returns</h4>Pointer to allocated attribute. This pointer will never be NULL. <p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_69729185bc59b0875192d667c47b8859_169729185bc59b0875192d667c47b8859">function memory_pool::allocate_string</h3><h4>Synopsis</h4><code class="synopsis">Ch* allocate_string(const Ch *source=0, std::size_t size=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Allocates a char array of given size from the pool, and optionally copies a given string to it. If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function. </para><h4>Parameters</h4><dl><dt class="parameter-name">source</dt><dd class="parameter-def">String to initialize the allocated memory with, or 0 to not initialize it. </dd></dl><dl><dt class="parameter-name">size</dt><dd class="parameter-def">Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. </dd></dl><h4>Returns</h4>Pointer to allocated char array. This poin
ter will never be NULL. <p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_95c49fcb056e9103ec906a59e3e01d76_195c49fcb056e9103ec906a59e3e01d76">function memory_pool::clone_node</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* clone_node(const xml_node&lt; Ch &gt; *source, xml_node&lt; Ch &gt; *result=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Clones an xml_node and its hierarchy of child nodes and attributes. Nodes and attributes are allocated from this memory pool. Names and values are not cloned, they are shared between the clone and the source. Result node can be optionally specified as a second parameter, in which case its contents will be replaced with cloned source node. This is useful when you want to clone entire document. </para><h4>Parameters</h4><dl><dt class="parameter-name">source</dt><dd class="parameter-def">Node to clone. </dd></dl><dl><dt class="parameter-name">result</dt><dd class="parameter-def">Node to put results in, or 0 to automatically allocate result node </dd></dl><h4>Returns</h4>Pointer to cloned node. This pointer will never be NULL. <p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_c8bb3912a3ce86b15842e79d0b421204_1c8bb3912a3ce86b15842e79d0b421
204">function memory_pool::clear</h3><h4>Synopsis</h4><code class="synopsis">void clear();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Clears the pool. This causes memory occupied by nodes allocated by the pool to be freed. Any nodes or strings allocated from the pool will no longer be valid. </para><p/><h3 class="reference-header" id="classrapidxml_1_1memory__pool_c0a55a6ef0837dca67572e357100d78a_1c0a55a6ef0837dca67572e357100d78a">function memory_pool::set_allocator</h3><h4>Synopsis</h4><code class="synopsis">void set_allocator(alloc_func *af, free_func *ff);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets or resets the user-defined memory allocation functions for the pool. This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. Allocation function must not return invalid pointer on failure. It should either throw, stop the program, or use <code>longjmp()</code> function to pass control to other place of program. If it returns invalid pointer, results are undefined. <br/><br/>
+ User defined allocation functions must have the following forms: <br/><code><br/>
+void *allocate(std::size_t size); <br/>
+void free(void *pointer); </code><br/></para><h4>Parameters</h4><dl><dt class="parameter-name">af</dt><dd class="parameter-def">Allocation function, or 0 to restore default function </dd></dl><dl><dt class="parameter-name">ff</dt><dd class="parameter-def">Free function, or 0 to restore default function </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1parse__error">class rapidxml::parse_error</h3>
+
+ Defined in rapidxml.hpp<br/><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse error exception. This exception is thrown by the parser when an error occurs. Use what() function to get human-readable error message. Use where() function to get a pointer to position within source text where error was detected. <br/><br/>
+ If throwing exceptions by the parser is undesirable, it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. This function must be defined by the user. <br/><br/>
+ This class derives from <code>std::exception</code> class. </para><p/><h3 class="reference-header" id="classrapidxml_1_1parse__error_4dd8d1bdbd9221df4dcb90cafaee3332_14dd8d1bdbd9221df4dcb90cafaee3332">
+ constructor
+ parse_error::parse_error</h3><h4>Synopsis</h4><code class="synopsis">parse_error(const char *what, void *where);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Constructs parse error. </para><p/><h3 class="reference-header" id="classrapidxml_1_1parse__error_ff06f49065b54a8a86e02e9a2441a8ba_1ff06f49065b54a8a86e02e9a2441a8ba">function parse_error::what</h3><h4>Synopsis</h4><code class="synopsis">virtual const char* what() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets human readable description of error. </para><h4>Returns</h4>Pointer to null terminated description of the error. <p/><h3 class="reference-header" id="classrapidxml_1_1parse__error_377be7d201d95221c318682c35377aca_1377be7d201d95221c318682c35377aca">function parse_error::where</h3><h4>Synopsis</h4><code class="synopsis">Ch* where() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets pointer to character data where error happened. Ch should be the same as char type of xml_document that produced the error. </para><h4>Returns</h4>Pointer to location within the parsed string where error occured. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__attribute">class
+ template
+ rapidxml::xml_attribute</h3>
+
+ Defined in rapidxml.hpp<br/>
+ Inherits from
+ xml_base <br/><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Class representing attribute node of XML document. Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). Note that after parse, both name and value of attribute will point to interior of source text used for parsing. Thus, this text must persist in memory for the lifetime of attribute. </para><h4>Parameters</h4><dl><dt class="parameter-name">Ch</dt><dd>Character type to use. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__attribute_d5464aadf08269a886b730993525db34_
1d5464aadf08269a886b730993525db34">
+ constructor
+ xml_attribute::xml_attribute</h3><h4>Synopsis</h4><code class="synopsis">xml_attribute();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Constructs an empty attribute with the specified type. Consider using memory_pool of appropriate xml_document if allocating attributes manually. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__attribute_77aea7d8d996ba4f6bd61cc478a4e72d_177aea7d8d996ba4f6bd61cc478a4e72d">function xml_attribute::document</h3><h4>Synopsis</h4><code class="synopsis">xml_document&lt;Ch&gt;* document() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets document of which attribute is a child. </para><h4>Returns</h4>Pointer to document that contains this attribute, or 0 if there is no parent document. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__attribute_5c4a98d2b75f9b41b12c110108fd55ab_15c4a98d2b75f9b41b12c110108fd55ab">function xml_attribute::previous_attribute</h3><h4>Synopsis</h4><code class="synopsis">xml_attribute&lt;Ch&gt;* previous_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets previous attribute, optionally matching attribute name. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found attribute, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__attribute_1b8a814d0d3a7165396b08433eee8a91_11b8a814d0d3a7165396b08433eee8a91">function xml_attribute::next_attrib
ute</h3><h4>Synopsis</h4><code class="synopsis">xml_attribute&lt;Ch&gt;* next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets next attribute, optionally matching attribute name. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found attribute, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__base">class
+ template
+ rapidxml::xml_base</h3>
+
+ Defined in rapidxml.hpp<br/>
+ Base class for
+ xml_attribute xml_node <h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Base class for xml_node and xml_attribute implementing common functions: name(), name_size(), value(), value_size() and <a href="#classrapidxml_1_1xml__base_798e8df7ea53ade4d9f0701017dce80e
_1798e8df7ea53ade4d9f0701017dce80e" kindref="member">parent()</a>. </para><h4>Parameters</h4><dl><dt class="parameter-name">Ch</dt><dd>Character type to use </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_23630d2c130a9e0e3f3afa7584a9b218_123630d2c130a9e0e3f3afa7584a9b218">
+ constructor
+ xml_base::xml_base</h3><h4>Synopsis</h4><code class="synopsis">xml_base();
+ </code><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_622eade29fdf7806d3ef93ac4d90e707_1622eade29fdf7806d3ef93ac4d90e707">function xml_base::name</h3><h4>Synopsis</h4><code class="synopsis">Ch* name() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets name of the node. Interpretation of name depends on type of node. Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. <br/><br/>
+ Use name_size() function to determine length of the name. </para><h4>Returns</h4>Name of node, or empty string if node has no name. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_0dae694c8f7e4d89f1003e2f3a15a43c_10dae694c8f7e4d89f1003e2f3a15a43c">function xml_base::name_size</h3><h4>Synopsis</h4><code class="synopsis">std::size_t name_size() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets size of node name, not including terminator character. This function works correctly irrespective of whether name is or is not zero terminated. </para><h4>Returns</h4>Size of node name, in characters. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_c54fa4987fb503916a7b541eb15c9c7f_1c54fa4987fb503916a7b541eb15c9c7f">function xml_base::value</h3><h4>Synopsis</h4><code class="synopsis">Ch* value() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets value of node. Interpretation of value depends on type of node. Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. <br/><br/>
+ Use value_size() function to determine length of the value. </para><h4>Returns</h4>Value of node, or empty string if node has no value. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_aed5ae791b7164c1ee5e649198cbb3db_1aed5ae791b7164c1ee5e649198cbb3db">function xml_base::value_size</h3><h4>Synopsis</h4><code class="synopsis">std::size_t value_size() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets size of node value, not including terminator character. This function works correctly irrespective of whether value is or is not zero terminated. </para><h4>Returns</h4>Size of node value, in characters. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_4e7e23d06d48126c65b1f6266acfba5c_14e7e23d06d48126c65b1f6266acfba5c">function xml_base::name</h3><h4>Synopsis</h4><code class="synopsis">void name(const Ch *name, std::size_t size);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets name of node to a non zero-terminated string. See Ownership Of Strings . <br/><br/>
+ Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed. <br/><br/>
+ Size of name must be specified separately, because name does not have to be zero terminated. Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of node to set. Does not have to be zero terminated. </dd></dl><dl><dt class="parameter-name">size</dt><dd class="parameter-def">Size of name, in characters. This does not include zero terminator, if one is present. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_e099c291e104a0d277307fe71f5e0f9e_1e099c291e104a0d277307fe71f5e0f9e">function xml_base::name</h3><h4>Synopsis</h4><code class="synopsis">void name(const Ch *name);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets name of node to a zero-terminated string. See also Ownership Of Strings and xml_node::name(const Ch *, std::size_t). </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of node to set. Must be zero terminated. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_d9640aa3f5374673cb72a5289b6c91eb_1d9640aa3f5374673cb72a5289b6c91eb">function xml_base::value</h3><h4>Synopsis</h4><code class="synopsis">void value(const Ch *value, std::size_t size);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets value of node to a non zero-terminated string. See Ownership Of Strings . <br/><br/>
+ Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed. <br/><br/>
+ Size of value must be specified separately, because it does not have to be zero terminated. Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). <br/><br/>
+ If an element has a child node of type node_data, it will take precedence over element value when printing. If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. </para><h4>Parameters</h4><dl><dt class="parameter-name">value</dt><dd class="parameter-def">value of node to set. Does not have to be zero terminated. </dd></dl><dl><dt class="parameter-name">size</dt><dd class="parameter-def">Size of value, in characters. This does not include zero terminator, if one is present. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_18c7469acdca771de9b4f3054053029c_118c7469acdca771de9b4f3054053029c">function xml_base::value</h3><h4>Synopsis</h4><code class="synopsis">void value(const Ch *value);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets value of node to a zero-terminated string. See also Ownership Of Strings and xml_node::value(const Ch *, std::size_t). </para><h4>Parameters</h4><dl><dt class="parameter-name">value</dt><dd class="parameter-def">Vame of node to set. Must be zero terminated. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__base_798e8df7ea53ade4d9f0701017dce80e_1798e8df7ea53ade4d9f0701017dce80e">function xml_base::parent</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* parent() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets node parent. </para><h4>Returns</h4>Pointer to parent node, or 0 if there is no parent. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__document">class
+ template
+ rapidxml::xml_document</h3>
+
+ Defined in rapidxml.hpp<br/>
+ Inherits from
+ xml_node memory_pool <br/><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">This class represents root of the DOM hierarchy. It is also an xml_node and a memory_pool through public inheritance. Use parse() function to build a DOM tree from a zero-terminated XML text string. parse() function allocates memory for nodes and attributes by using functions of xml_document, which are inherited from <a href="#classrapidxml_1_1memory__pool" kindref="
compound">memory_pool</a>. To access root node of the document, use the document itself, as if it was an xml_node. </para><h4>Parameters</h4><dl><dt class="parameter-name">Ch</dt><dd>Character type to use. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__document_6ce266cc52d549c42abe3a3d5e8af9ba_16ce266cc52d549c42abe3a3d5e8af9ba">
+ constructor
+ xml_document::xml_document</h3><h4>Synopsis</h4><code class="synopsis">xml_document();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Constructs empty XML document. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__document_8338ce6042e7b04d5a42144fb446b69c_18338ce6042e7b04d5a42144fb446b69c">function xml_document::parse</h3><h4>Synopsis</h4><code class="synopsis">void parse(Ch *text);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parses zero-terminated XML string according to given flags. Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. The string must persist for the lifetime of the document. In case of error, rapidxml::parse_error exception will be thrown. <br/><br/>
+ If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. Make sure that data is zero-terminated. <br/><br/>
+ Document can be parsed into multiple times. Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. </para><h4>Parameters</h4><dl><dt class="parameter-name">text</dt><dd class="parameter-def">XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__document_c8bb3912a3ce86b15842e79d0b421204_1c8bb3912a3ce86b15842e79d0b421204">function xml_document::clear</h3><h4>Synopsis</h4><code class="synopsis">void clear();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Clears the document by deleting all nodes and clearing the memory pool. All nodes owned by document pool are destroyed. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node">class
+ template
+ rapidxml::xml_node</h3>
+
+ Defined in rapidxml.hpp<br/>
+ Inherits from
+ xml_base <br/>
+ Base class for
+ xml_document <h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Class representing a node of XML document. Each node may have associated name and value strings, which are available through name() and value() functions. Interpretation of name and value depends on type of the node. Type of node can be determined by using type() function. <br/><br/>
+ Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. Thus, this text must persist in the memory for the lifetime of node. </para><h4>Parameters</h4><dl><dt class="parameter-name">Ch</dt><dd>Character type to use. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_34c55af3504549a475e5b9dfcaa6adf5_134c55af3504549a475e5b9dfcaa6adf5">
+ constructor
+ xml_node::xml_node</h3><h4>Synopsis</h4><code class="synopsis">xml_node(node_type type);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Constructs an empty node with the specified type. Consider using memory_pool of appropriate document to allocate nodes manually. </para><h4>Parameters</h4><dl><dt class="parameter-name">type</dt><dd class="parameter-def">Type of node to construct. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_975e86937621ae4afe6a423219de30d0_1975e86937621ae4afe6a423219de30d0">function xml_node::type</h3><h4>Synopsis</h4><code class="synopsis">node_type type() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets type of node. </para><h4>Returns</h4>Type of node. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_77aea7d8d996ba4f6bd61cc478a4e72d_177aea7d8d996ba4f6bd61cc478a4e72d">function xml_node::document</h3><h4>Synopsis</h4><code class="synopsis">xml_document&lt;Ch&gt;* document() const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets document of which node is a child. </para><h4>Returns</h4>Pointer to document that contains this node, or 0 if there is no parent document. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_7823e36687669e59c2afdf66334ef35a_17823e36687669e59c2afdf66334ef35a">function xml_node::first_node</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets first child node, optionally matching node name. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of child to find, or 0 to return first child regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found child, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_fcb6e2209b591a36d2dadba20d2bc7cc_1fcb6e2209b591a36d2dadba20d2bc7cc">function xml_node::last_node</h3><h4>Synopsis</h4><code class=
"synopsis">xml_node&lt;Ch&gt;* last_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets last child node, optionally matching node name. Behaviour is undefined if node has no children. Use first_node() to test if node has children. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of child to find, or 0 to return last child regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found c
hild, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_ac2f6886c0107e9d5f156e9542546df6_1ac2f6886c0107e9d5f156e9542546df6">function xml_node::previous_sibling</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* previous_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets previous sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to
 found sibling, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_b3ead2cefecc03a813836203e3f6f38f_1b3ead2cefecc03a813836203e3f6f38f">function xml_node::next_sibling</h3><h4>Synopsis</h4><code class="synopsis">xml_node&lt;Ch&gt;* next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets next sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found s
ibling, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_5810a09f82f8d53efbe9456286dcec83_15810a09f82f8d53efbe9456286dcec83">function xml_node::first_attribute</h3><h4>Synopsis</h4><code class="synopsis">xml_attribute&lt;Ch&gt;* first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets first attribute of node, optionally matching attribute name. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found attribute, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_16953d66751b5b949ee4ee2d9c0bc63a_116953d66751b5b949ee4ee2d9c0bc63a">function xml_node::last_attribute</h3>
<h4>Synopsis</h4><code class="synopsis">xml_attribute&lt;Ch&gt;* last_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Gets last attribute of node, optionally matching attribute name. </para><h4>Parameters</h4><dl><dt class="parameter-name">name</dt><dd class="parameter-def">Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn&apos;t have to be zero-terminated if name_size is non-zero </dd></dl><dl><dt class="parameter-name">name_size</dt><dd class="parameter-def">Size of name, in characters, or 0 to have size calculated automatically from string </dd></dl><dl><dt class="parameter-name">case_sensitive</dt><dd class="parameter-def">Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters </dd></dl><h4>Returns</h4>Pointer to found attribute, or 0 if not found. <p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_a78759bfa429fa2ab6bc5fe617cfa3cf_1a78759bfa429fa2ab6bc5fe617cfa3cf">function xml_node::type</h3><h4>Synopsis
</h4><code class="synopsis">void type(node_type type);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Sets type of node. </para><h4>Parameters</h4><dl><dt class="parameter-name">type</dt><dd class="parameter-def">Type of node to set. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_0c39df6617e709eb2fba11300dea63f2_10c39df6617e709eb2fba11300dea63f2">function xml_node::prepend_node</h3><h4>Synopsis</h4><code class="synopsis">void prepend_node(xml_node&lt; Ch &gt; *child);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Prepends a new child node. The prepended child becomes the first child, and all existing children are moved one position back. </para><h4>Parameters</h4><dl><dt class="parameter-name">child</dt><dd class="parameter-def">Node to prepend. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_86de2e22276826089b7baed2599f8dee_186de2e22276826089b7baed2599f8dee">function xml_node::append_node</h3><h4>Synopsis</h4><code class="synopsis">void append_node(xml_node&lt; Ch &gt; *child);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Appends a new child node. The appended child becomes the last child. </para><h4>Parameters</h4><dl><dt class="parameter-name">child</dt><dd class="parameter-def">Node to append. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_780972a57fc447250ab47cc8f421b65e_1780972a57fc447250ab47cc8f421b65e">function xml_node::insert_node</h3><h4>Synopsis</h4><code class="synopsis">void insert_node(xml_node&lt; Ch &gt; *where, xml_node&lt; Ch &gt; *child);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Inserts a new child node at specified place inside the node. All children after and including the specified node are moved one position back. </para><h4>Parameters</h4><dl><dt class="parameter-name">where</dt><dd class="parameter-def">Place where to insert the child, or 0 to insert at the back. </dd></dl><dl><dt class="parameter-name">child</dt><dd class="parameter-def">Node to insert. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_9a31d861e1bddc710839c551a5d2b3a4_19a31d861e1bddc710839c551a5d2b3a4">function xml_node::remove_first_node</h3><h4>Synopsis</h4><code class="synopsis">void remove_first_node();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes first child node. If node has no children, behaviour is undefined. Use first_node() to test if node has children. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_87addf2bc127ee31aa4b5295d3c9b530_187addf2bc127ee31aa4b5295d3c9b530">function xml_node::remove_last_node</h3><h4>Synopsis</h4><code class="synopsis">void remove_last_node();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes last child of the node. If node has no children, behaviour is undefined. Use first_node() to test if node has children. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_9316463a2201631e7e2062b17729f9cd_19316463a2201631e7e2062b17729f9cd">function xml_node::remove_node</h3><h4>Synopsis</h4><code class="synopsis">void remove_node(xml_node&lt; Ch &gt; *where);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes specified child from the node. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_0218147d13e41d5fa60ced4e7a7e9726_10218147d13e41d5fa60ced4e7a7e9726">function xml_node::remove_all_nodes</h3><h4>Synopsis</h4><code class="synopsis">void remove_all_nodes();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes all child nodes (but not attributes). </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_f6dffa513da74cc0be71a7ba84f8265e_1f6dffa513da74cc0be71a7ba84f8265e">function xml_node::prepend_attribute</h3><h4>Synopsis</h4><code class="synopsis">void prepend_attribute(xml_attribute&lt; Ch &gt; *attribute);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Prepends a new attribute to the node. </para><h4>Parameters</h4><dl><dt class="parameter-name">attribute</dt><dd class="parameter-def">Attribute to prepend. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_8fbd4f5ef7169d493da9f8d87ac04b77_18fbd4f5ef7169d493da9f8d87ac04b77">function xml_node::append_attribute</h3><h4>Synopsis</h4><code class="synopsis">void append_attribute(xml_attribute&lt; Ch &gt; *attribute);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Appends a new attribute to the node. </para><h4>Parameters</h4><dl><dt class="parameter-name">attribute</dt><dd class="parameter-def">Attribute to append. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_070d5888b0557fe06a5b24961de1b988_1070d5888b0557fe06a5b24961de1b988">function xml_node::insert_attribute</h3><h4>Synopsis</h4><code class="synopsis">void insert_attribute(xml_attribute&lt; Ch &gt; *where, xml_attribute&lt; Ch &gt; *attribute);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Inserts a new attribute at specified place inside the node. All attributes after and including the specified attribute are moved one position back. </para><h4>Parameters</h4><dl><dt class="parameter-name">where</dt><dd class="parameter-def">Place where to insert the attribute, or 0 to insert at the back. </dd></dl><dl><dt class="parameter-name">attribute</dt><dd class="parameter-def">Attribute to insert. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_4eea4a7f6cb484ca9944f7eafe6e1843_14eea4a7f6cb484ca9944f7eafe6e1843">function xml_node::remove_first_attribute</h3><h4>Synopsis</h4><code class="synopsis">void remove_first_attribute();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes first attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_37d87c4d5d89fa0cf05b72ee8d4cba3b_137d87c4d5d89fa0cf05b72ee8d4cba3b">function xml_node::remove_last_attribute</h3><h4>Synopsis</h4><code class="synopsis">void remove_last_attribute();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes last attribute of the node. If node has no attributes, behaviour is undefined. Use first_attribute() to test if node has attributes. </para><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_c75154db2e768c0e5b541fc8cd0775ab_1c75154db2e768c0e5b541fc8cd0775ab">function xml_node::remove_attribute</h3><h4>Synopsis</h4><code class="synopsis">void remove_attribute(xml_attribute&lt; Ch &gt; *where);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes specified attribute from node. </para><h4>Parameters</h4><dl><dt class="parameter-name">where</dt><dd class="parameter-def">Pointer to attribute to be removed. </dd></dl><p/><h3 class="reference-header" id="classrapidxml_1_1xml__node_59e6ad4cfd5e8096c052e71d79561eda_159e6ad4cfd5e8096c052e71d79561eda">function xml_node::remove_all_attributes</h3><h4>Synopsis</h4><code class="synopsis">void remove_all_attributes();
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Removes all attributes of node. </para><p/><h3 class="reference-header" id="namespacerapidxml_6a276b85e2da28c5f9c3dbce61c55682_16a276b85e2da28c5f9c3dbce61c55682">enum node_type</h3><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Enumeration listing all node types produced by the parser. Use xml_node::type() function to query node type. </para><h4>Values</h4><dl><dt class="parameter-name">node_document</dt><dd class="parameter-def">A document node. Name and value are empty. </dd></dl><dl><dt class="parameter-name">node_element</dt><dd class="parameter-def">An element node. Name contains element name. Value contains text of first data node. </dd></dl><dl><dt class="parameter-name">node_data</dt><dd class="parameter-def">A data node. Name is empty. Value cont
ains data text. </dd></dl><dl><dt class="parameter-name">node_cdata</dt><dd class="parameter-def">A CDATA node. Name is empty. Value contains data text. </dd></dl><dl><dt class="parameter-name">node_comment</dt><dd class="parameter-def">A comment node. Name is empty. Value contains comment text. </dd></dl><dl><dt class="parameter-name">node_declaration</dt><dd class="parameter-def">A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. </dd></dl><dl><dt class="parameter-name">node_doctype</dt><dd class="parameter-def">A DOCTYPE node. Name is empty. Value contains DOCTYPE text. </dd></dl><dl><dt class="parameter-name">node_pi</dt><dd class="parameter-def">A PI node. Name contains target. Value contains instructions. </dd></dl><p/><h3 class="reference-header" id="namespacerapidxml_ff5d67f74437199d316d2b2660653ae1_1ff5d67f74437199d316d2b2660653ae1">function parse_error_handler</h3><h4>Synopsis</h4><code class="synopsis">void rapidxml::pars
e_error_handler(const char *what, void *where);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function is called to notify user about the error. It must be defined by the user. <br/><br/>
+ This function cannot return. If it does, the results are undefined. <br/><br/>
+ A very simple definition might look like that: <preformatted>
+ void rapidxml::parse_error_handler(const char *what, void *where)
+ {
+ std::cout &lt;&lt; &quot;Parse error: &quot; &lt;&lt; what &lt;&lt; &quot;\n&quot;;
+ std::abort();
+ }
+ </preformatted></para><h4>Parameters</h4><dl><dt class="parameter-name">what</dt><dd class="parameter-def">Human readable description of the error. </dd></dl><dl><dt class="parameter-name">where</dt><dd class="parameter-def">Pointer to character data where error was detected. </dd></dl><p/><h3 class="reference-header" id="namespacerapidxml_b94d570fc4c4ab2423813cd0243326b1_1b94d570fc4c4ab2423813cd0243326b1">function print</h3><h4>Synopsis</h4><code class="synopsis">OutIt rapidxml::print(OutIt out, const xml_node&lt; Ch &gt; &amp;node, int flags=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Prints XML to given output iterator. </para><h4>Parameters</h4><dl><dt class="parameter-name">out</dt><dd class="parameter-def">Output iterator to print to. </dd></dl><dl><dt class="parameter-name">node</dt><dd class="parameter-def">Node to be printed. Pass xml_document to print entire document. </dd></dl><dl><dt class="parameter-name">flags</dt><dd class="parameter-def">Flags controlling how XML is printed. </dd></dl><h4>Returns</h4>Output iterator pointing to position immediately after last character of printed text. <p/><h3 class="reference-header" id="namespacerapidxml_13bc37d6d1047acb0efdbc1689221a5e_113bc37d6d1047acb0efdbc1689221a5e">function print</h3><h4>Synopsis</h4><code class="synopsis">std::basic_ostream&lt;Ch&gt;&amp; rapidxml::print(std::basic_ostream&lt; Ch &gt; &amp;out, const xml_node&lt; Ch &gt; &amp;node, int flags=0);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Prints XML to given output stream. </para><h4>Parameters</h4><dl><dt class="parameter-name">out</dt><dd class="parameter-def">Output stream to print to. </dd></dl><dl><dt class="parameter-name">node</dt><dd class="parameter-def">Node to be printed. Pass xml_document to print entire document. </dd></dl><dl><dt class="parameter-name">flags</dt><dd class="parameter-def">Flags controlling how XML is printed. </dd></dl><h4>Returns</h4>Output stream. <p/><h3 class="reference-header" id="namespacerapidxml_5619b38000d967fb223b2b0a8c17463a_15619b38000d967fb223b2b0a8c17463a">function operator&lt;&lt;</h3><h4>Synopsis</h4><code class="synopsis">std::basic_ostream&lt;Ch&gt;&amp; rapidxml::operator&lt;&lt;(std::basic_ostream&lt; Ch &gt; &amp;out, const xml_node&lt; Ch &gt; &amp;node);
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. </para><h4>Parameters</h4><dl><dt class="parameter-name">out</dt><dd class="parameter-def">Output stream to print to. </dd></dl><dl><dt class="parameter-name">node</dt><dd class="parameter-def">Node to be printed. </dd></dl><h4>Returns</h4>Output stream. <p/><h3 class="reference-header" id="namespacerapidxml_87e8bbab53702cf3b438bd553c10b6b9_187e8bbab53702cf3b438bd553c10b6b9">
+ constant
+ parse_no_data_nodes</h3><h4>Synopsis</h4><code class="synopsis">const int parse_no_data_nodes
+ = 0x1;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to not create data nodes. Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_97e2c4fdc04fae17126f9971a4fc993e_197e2c4fdc04fae17126f9971a4fc993e">
+ constant
+ parse_no_element_values</h3><h4>Synopsis</h4><code class="synopsis">const int parse_no_element_values
+ = 0x2;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to not use text of first data node as a value of parent element. Can be combined with other flags by use of | operator. Note that child data nodes of element node take precendence over its value when printing. That is, if element has one or more child data nodes <i>and</i> a value, the value will be ignored. Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_9cae3801e70437cbc410c24bf6be691c_19cae3801e70437cbc410c24bf6be691c">
+ constant
+ parse_no_string_terminators</h3><h4>Synopsis</h4><code class="synopsis">const int parse_no_string_terminators
+ = 0x4;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to not place zero terminators after strings in the source text. By default zero terminators are placed, modifying source text. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_7223b7815c4fb8b42e6e4e77e1ea6b97_17223b7815c4fb8b42e6e4e77e1ea6b97">
+ constant
+ parse_no_entity_translation</h3><h4>Synopsis</h4><code class="synopsis">const int parse_no_entity_translation
+ = 0x8;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to not translate entities in the source text. By default entities are translated, modifying source text. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_ccde57f6054857ee4042a1b4d98c83b9_1ccde57f6054857ee4042a1b4d98c83b9">
+ constant
+ parse_no_utf8</h3><h4>Synopsis</h4><code class="synopsis">const int parse_no_utf8
+ = 0x10;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. By default, UTF-8 handling is enabled. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_52e2c934ad9c845a5f4cc49570470556_152e2c934ad9c845a5f4cc49570470556">
+ constant
+ parse_declaration_node</h3><h4>Synopsis</h4><code class="synopsis">const int parse_declaration_node
+ = 0x20;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to create XML declaration node. By default, declaration node is not created. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_0f7479dacbc868456d07897a8c072784_10f7479dacbc868456d07897a8c072784">
+ constant
+ parse_comment_nodes</h3><h4>Synopsis</h4><code class="synopsis">const int parse_comment_nodes
+ = 0x40;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to create comments nodes. By default, comment nodes are not created. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_8e187746ba1ca04f107951ad32df962e_18e187746ba1ca04f107951ad32df962e">
+ constant
+ parse_doctype_node</h3><h4>Synopsis</h4><code class="synopsis">const int parse_doctype_node
+ = 0x80;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to create DOCTYPE node. By default, doctype node is not created. Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_1c20b2b2b75711cd76423e119c49f830_11c20b2b2b75711cd76423e119c49f830">
+ constant
+ parse_pi_nodes</h3><h4>Synopsis</h4><code class="synopsis">const int parse_pi_nodes
+ = 0x100;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to create PI nodes. By default, PI nodes are not created. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_a5daff9d61c7d4eaf98e4d42efe628ee_1a5daff9d61c7d4eaf98e4d42efe628ee">
+ constant
+ parse_validate_closing_tags</h3><h4>Synopsis</h4><code class="synopsis">const int parse_validate_closing_tags
+ = 0x200;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to validate closing tag names. If not set, name inside closing tag is irrelevant to the parser. By default, closing tags are not validated. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_ac1f06b1afd47b812732fb521b146fd9_1ac1f06b1afd47b812732fb521b146fd9">
+ constant
+ parse_trim_whitespace</h3><h4>Synopsis</h4><code class="synopsis">const int parse_trim_whitespace
+ = 0x400;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. By default, whitespace is not trimmed. This flag does not cause the parser to modify source text. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_88f95d4e275ba01408fefde83078651b_188f95d4e275ba01408fefde83078651b">
+ constant
+ parse_normalize_whitespace</h3><h4>Synopsis</h4><code class="synopsis">const int parse_normalize_whitespace
+ = 0x800;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. By default, whitespace is not normalized. If this flag is specified, source text will be modified. Can be combined with other flags by use of | operator. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_45751cf2f38fd6915f35b3122b46d5b6_145751cf2f38fd6915f35b3122b46d5b6">
+ constant
+ parse_default</h3><h4>Synopsis</h4><code class="synopsis">const int parse_default
+ = 0;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Parse flags which represent default behaviour of the parser. This is always equal to 0, so that all other flags can be simply ored together. Normally there is no need to inconveniently disable flags by anding with their negated (~) values. This also means that meaning of each flag is a <i>negation</i> of the default setting. For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is <i>enabled</i> by default, and using the flag will disable it. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_a97ba1a0a79a6d66f4eef3612508d943_1a97ba1a0a79a6d66f4eef3612508d943">
+ constant
+ parse_non_destructive</h3><h4>Synopsis</h4><code class="synopsis">const int parse_non_destructive
+ = parse_no_string_terminators | parse_no_entity_translation;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">A combination of parse flags that forbids any modifications of the source text. This also results in faster parsing. However, note that the following will occur: <ul><li><para>names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends </para></li><li><para>entities will not be translated </para></li><li><para>whitespace will not be normalized </para></li></ul>
+See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_398c5476e76102f8bd76c10bb0abbe10_1398c5476e76102f8bd76c10bb0abbe10">
+ constant
+ parse_fastest</h3><h4>Synopsis</h4><code class="synopsis">const int parse_fastest
+ = parse_non_destructive | parse_no_data_nodes;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_b4f2515265facb42291570307924bd57_1b4f2515265facb42291570307924bd57">
+ constant
+ parse_full</h3><h4>Synopsis</h4><code class="synopsis">const int parse_full
+ = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">A combination of parse flags resulting in largest amount of data being extracted. This usually results in slowest parsing. <br/><br/>
+ See xml_document::parse() function. </para><p/><h3 class="reference-header" id="namespacerapidxml_b08b8d4293c203b69ed6c5ae77ac1907_1b08b8d4293c203b69ed6c5ae77ac1907">
+ constant
+ print_no_indenting</h3><h4>Synopsis</h4><code class="synopsis">const int print_no_indenting
+ = 0x1;
+ </code><h4>Description</h4><para xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Printer flag instructing the printer to suppress indenting of XML. See print() function. </para><p/></body></html>
\ No newline at end of file

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,2596 @@
+#ifndef RAPIDXML_HPP_INCLUDED
+#define RAPIDXML_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation
+
+// If standard library is disabled, user must provide implementations of required functions and typedefs
+#if !defined(RAPIDXML_NO_STDLIB)
+ #include <cstdlib> // For std::size_t
+ #include <cassert> // For assert
+ #include <new> // For placement new
+#endif
+
+// On MSVC, disable "conditional expression is constant" warning (level 4).
+// This warning is almost impossible to avoid with certain types of templated code
+#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4127) // Conditional expression is constant
+#endif
+
+///////////////////////////////////////////////////////////////////////////
+// RAPIDXML_PARSE_ERROR
+
+#if defined(RAPIDXML_NO_EXCEPTIONS)
+
+#define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); }
+
+namespace rapidxml
+{
+ //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS,
+ //! this function is called to notify user about the error.
+ //! It must be defined by the user.
+ //! <br><br>
+ //! This function cannot return. If it does, the results are undefined.
+ //! <br><br>
+ //! A very simple definition might look like that:
+ //! <pre>
+ //! void %rapidxml::%parse_error_handler(const char *what, void *where)
+ //! {
+ //! std::cout << "Parse error: " << what << "\n";
+ //! std::abort();
+ //! }
+ //! </pre>
+ //! \param what Human readable description of the error.
+ //! \param where Pointer to character data where error was detected.
+ void parse_error_handler(const char *what, void *where);
+}
+
+#else
+
+#include <exception> // For std::exception
+
+#define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where)
+
+namespace rapidxml
+{
+
+ //! Parse error exception.
+ //! This exception is thrown by the parser when an error occurs.
+ //! Use what() function to get human-readable error message.
+ //! Use where() function to get a pointer to position within source text where error was detected.
+ //! <br><br>
+ //! If throwing exceptions by the parser is undesirable,
+ //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included.
+ //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception.
+ //! This function must be defined by the user.
+ //! <br><br>
+ //! This class derives from <code>std::exception</code> class.
+ class parse_error: public std::exception
+ {
+
+ public:
+
+ //! Constructs parse error
+ parse_error(const char *what, void *where)
+ : m_what(what)
+ , m_where(where)
+ {
+ }
+
+ //! Gets human readable description of error.
+ //! \return Pointer to null terminated description of the error.
+ virtual const char *what() const throw()
+ {
+ return m_what;
+ }
+
+ //! Gets pointer to character data where error happened.
+ //! Ch should be the same as char type of xml_document that produced the error.
+ //! \return Pointer to location within the parsed string where error occured.
+ template<class Ch>
+ Ch *where() const
+ {
+ return reinterpret_cast<Ch *>(m_where);
+ }
+
+ private:
+
+ const char *m_what;
+ void *m_where;
+
+ };
+}
+
+#endif
+
+///////////////////////////////////////////////////////////////////////////
+// Pool sizes
+
+#ifndef RAPIDXML_STATIC_POOL_SIZE
+ // Size of static memory block of memory_pool.
+ // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
+ // No dynamic memory allocations are performed by memory_pool until static memory is exhausted.
+ #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
+#endif
+
+#ifndef RAPIDXML_DYNAMIC_POOL_SIZE
+ // Size of dynamic memory block of memory_pool.
+ // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
+ // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool.
+ #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
+#endif
+
+#ifndef RAPIDXML_ALIGNMENT
+ // Memory allocation alignment.
+ // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer.
+ // All memory allocations for nodes, attributes and strings will be aligned to this value.
+ // This must be a power of 2 and at least 1, otherwise memory_pool will not work.
+ #define RAPIDXML_ALIGNMENT sizeof(void *)
+#endif
+
+namespace rapidxml
+{
+ // Forward declarations
+ template<class Ch> class xml_node;
+ template<class Ch> class xml_attribute;
+ template<class Ch> class xml_document;
+
+ //! Enumeration listing all node types produced by the parser.
+ //! Use xml_node::type() function to query node type.
+ enum node_type
+ {
+ node_document, //!< A document node. Name and value are empty.
+ node_element, //!< An element node. Name contains element name. Value contains text of first data node.
+ node_data, //!< A data node. Name is empty. Value contains data text.
+ node_cdata, //!< A CDATA node. Name is empty. Value contains data text.
+ node_comment, //!< A comment node. Name is empty. Value contains comment text.
+ node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes.
+ node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text.
+ node_pi //!< A PI node. Name contains target. Value contains instructions.
+ };
+
+ ///////////////////////////////////////////////////////////////////////
+ // Parsing flags
+
+ //! Parse flag instructing the parser to not create data nodes.
+ //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_no_data_nodes = 0x1;
+
+ //! Parse flag instructing the parser to not use text of first data node as a value of parent element.
+ //! Can be combined with other flags by use of | operator.
+ //! Note that child data nodes of element node take precendence over its value when printing.
+ //! That is, if element has one or more child data nodes <em>and</em> a value, the value will be ignored.
+ //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_no_element_values = 0x2;
+
+ //! Parse flag instructing the parser to not place zero terminators after strings in the source text.
+ //! By default zero terminators are placed, modifying source text.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_no_string_terminators = 0x4;
+
+ //! Parse flag instructing the parser to not translate entities in the source text.
+ //! By default entities are translated, modifying source text.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_no_entity_translation = 0x8;
+
+ //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters.
+ //! By default, UTF-8 handling is enabled.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_no_utf8 = 0x10;
+
+ //! Parse flag instructing the parser to create XML declaration node.
+ //! By default, declaration node is not created.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_declaration_node = 0x20;
+
+ //! Parse flag instructing the parser to create comments nodes.
+ //! By default, comment nodes are not created.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_comment_nodes = 0x40;
+
+ //! Parse flag instructing the parser to create DOCTYPE node.
+ //! By default, doctype node is not created.
+ //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_doctype_node = 0x80;
+
+ //! Parse flag instructing the parser to create PI nodes.
+ //! By default, PI nodes are not created.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_pi_nodes = 0x100;
+
+ //! Parse flag instructing the parser to validate closing tag names.
+ //! If not set, name inside closing tag is irrelevant to the parser.
+ //! By default, closing tags are not validated.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_validate_closing_tags = 0x200;
+
+ //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes.
+ //! By default, whitespace is not trimmed.
+ //! This flag does not cause the parser to modify source text.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_trim_whitespace = 0x400;
+
+ //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character.
+ //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag.
+ //! By default, whitespace is not normalized.
+ //! If this flag is specified, source text will be modified.
+ //! Can be combined with other flags by use of | operator.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_normalize_whitespace = 0x800;
+
+ // Compound flags
+
+ //! Parse flags which represent default behaviour of the parser.
+ //! This is always equal to 0, so that all other flags can be simply ored together.
+ //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values.
+ //! This also means that meaning of each flag is a <i>negation</i> of the default setting.
+ //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is <i>enabled</i> by default,
+ //! and using the flag will disable it.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_default = 0;
+
+ //! A combination of parse flags that forbids any modifications of the source text.
+ //! This also results in faster parsing. However, note that the following will occur:
+ //! <ul>
+ //! <li>names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends</li>
+ //! <li>entities will not be translated</li>
+ //! <li>whitespace will not be normalized</li>
+ //! </ul>
+ //! See xml_document::parse() function.
+ const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation;
+
+ //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_fastest = parse_non_destructive | parse_no_data_nodes;
+
+ //! A combination of parse flags resulting in largest amount of data being extracted.
+ //! This usually results in slowest parsing.
+ //! <br><br>
+ //! See xml_document::parse() function.
+ const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags;
+
+ ///////////////////////////////////////////////////////////////////////
+ // Internals
+
+ //! \cond internal
+ namespace internal
+ {
+
+ // Struct that contains lookup tables for the parser
+ // It must be a template to allow correct linking (because it has static data members, which are defined in a header file).
+ template<int Dummy>
+ struct lookup_tables
+ {
+ static const unsigned char lookup_whitespace[256]; // Whitespace table
+ static const unsigned char lookup_node_name[256]; // Node name table
+ static const unsigned char lookup_text[256]; // Text table
+ static const unsigned char lookup_text_pure_no_ws[256]; // Text table
+ static const unsigned char lookup_text_pure_with_ws[256]; // Text table
+ static const unsigned char lookup_attribute_name[256]; // Attribute name table
+ static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote
+ static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote
+ static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes
+ static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes
+ static const unsigned char lookup_digits[256]; // Digits
+ static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters
+ };
+
+ // Find length of the string
+ template<class Ch>
+ inline std::size_t measure(const Ch *p)
+ {
+ const Ch *tmp = p;
+ while (*tmp)
+ ++tmp;
+ return tmp - p;
+ }
+
+ // Compare strings for equality
+ template<class Ch>
+ inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive)
+ {
+ if (size1 != size2)
+ return false;
+ if (case_sensitive)
+ {
+ for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
+ if (*p1 != *p2)
+ return false;
+ }
+ else
+ {
+ for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
+ if (lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p1)] != lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p2)])
+ return false;
+ }
+ return true;
+ }
+ }
+ //! \endcond
+
+ ///////////////////////////////////////////////////////////////////////
+ // Memory pool
+
+ //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation.
+ //! In most cases, you will not need to use this class directly.
+ //! However, if you need to create nodes manually or modify names/values of nodes,
+ //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory.
+ //! Not only is this faster than allocating them by using <code>new</code> operator,
+ //! but also their lifetime will be tied to the lifetime of document,
+ //! possibly simplyfing memory management.
+ //! <br><br>
+ //! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool.
+ //! You can also call allocate_string() function to allocate strings.
+ //! Such strings can then be used as names or values of nodes without worrying about their lifetime.
+ //! Note that there is no <code>free()</code> function -- all allocations are freed at once when clear() function is called,
+ //! or when the pool is destroyed.
+ //! <br><br>
+ //! It is also possible to create a standalone memory_pool, and use it
+ //! to allocate nodes, whose lifetime will not be tied to any document.
+ //! <br><br>
+ //! Pool maintains <code>RAPIDXML_STATIC_POOL_SIZE</code> bytes of statically allocated memory.
+ //! Until static memory is exhausted, no dynamic memory allocations are done.
+ //! When static memory is exhausted, pool allocates additional blocks of memory of size <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> each,
+ //! by using global <code>new[]</code> and <code>delete[]</code> operators.
+ //! This behaviour can be changed by setting custom allocation routines.
+ //! Use set_allocator() function to set them.
+ //! <br><br>
+ //! Allocations for nodes, attributes and strings are aligned at <code>RAPIDXML_ALIGNMENT</code> bytes.
+ //! This value defaults to the size of pointer on target architecture.
+ //! <br><br>
+ //! To obtain absolutely top performance from the parser,
+ //! it is important that all nodes are allocated from a single, contiguous block of memory.
+ //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably.
+ //! If required, you can tweak <code>RAPIDXML_STATIC_POOL_SIZE</code>, <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> and <code>RAPIDXML_ALIGNMENT</code>
+ //! to obtain best wasted memory to performance compromise.
+ //! To do it, define their values before rapidxml.hpp file is included.
+ //! \param Ch Character type of created nodes.
+ template<class Ch = char>
+ class memory_pool
+ {
+
+ public:
+
+ //! \cond internal
+ typedef void *(alloc_func)(std::size_t); // Type of user-defined function used to allocate memory
+ typedef void (free_func)(void *); // Type of user-defined function used to free memory
+ //! \endcond
+
+ //! Constructs empty pool with default allocator functions.
+ memory_pool()
+ : m_alloc_func(0)
+ , m_free_func(0)
+ {
+ init();
+ }
+
+ //! Destroys pool and frees all the memory.
+ //! This causes memory occupied by nodes allocated by the pool to be freed.
+ //! Nodes allocated from the pool are no longer valid.
+ ~memory_pool()
+ {
+ clear();
+ }
+
+ //! Allocates a new node from the pool, and optionally assigns name and value to it.
+ //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+ //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+ //! will call rapidxml::parse_error_handler() function.
+ //! \param type Type of node to create.
+ //! \param name Name to assign to the node, or 0 to assign no name.
+ //! \param value Value to assign to the node, or 0 to assign no value.
+ //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string.
+ //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string.
+ //! \return Pointer to allocated node. This pointer will never be NULL.
+ xml_node<Ch> *allocate_node(node_type type,
+ const Ch *name = 0, const Ch *value = 0,
+ std::size_t name_size = 0, std::size_t value_size = 0)
+ {
+ void *memory = allocate_aligned(sizeof(xml_node<Ch>));
+ xml_node<Ch> *node = new(memory) xml_node<Ch>(type);
+ if (name)
+ {
+ if (name_size > 0)
+ node->name(name, name_size);
+ else
+ node->name(name);
+ }
+ if (value)
+ {
+ if (value_size > 0)
+ node->value(value, value_size);
+ else
+ node->value(value);
+ }
+ return node;
+ }
+
+ //! Allocates a new attribute from the pool, and optionally assigns name and value to it.
+ //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+ //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+ //! will call rapidxml::parse_error_handler() function.
+ //! \param name Name to assign to the attribute, or 0 to assign no name.
+ //! \param value Value to assign to the attribute, or 0 to assign no value.
+ //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string.
+ //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string.
+ //! \return Pointer to allocated attribute. This pointer will never be NULL.
+ xml_attribute<Ch> *allocate_attribute(const Ch *name = 0, const Ch *value = 0,
+ std::size_t name_size = 0, std::size_t value_size = 0)
+ {
+ void *memory = allocate_aligned(sizeof(xml_attribute<Ch>));
+ xml_attribute<Ch> *attribute = new(memory) xml_attribute<Ch>;
+ if (name)
+ {
+ if (name_size > 0)
+ attribute->name(name, name_size);
+ else
+ attribute->name(name);
+ }
+ if (value)
+ {
+ if (value_size > 0)
+ attribute->value(value, value_size);
+ else
+ attribute->value(value);
+ }
+ return attribute;
+ }
+
+ //! Allocates a char array of given size from the pool, and optionally copies a given string to it.
+ //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+ //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+ //! will call rapidxml::parse_error_handler() function.
+ //! \param source String to initialize the allocated memory with, or 0 to not initialize it.
+ //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated.
+ //! \return Pointer to allocated char array. This pointer will never be NULL.
+ Ch *allocate_string(const Ch *source = 0, std::size_t size = 0)
+ {
+ assert(source || size); // Either source or size (or both) must be specified
+ if (size == 0)
+ size = internal::measure(source) + 1;
+ Ch *result = static_cast<Ch *>(allocate_aligned(size * sizeof(Ch)));
+ if (source)
+ for (std::size_t i = 0; i < size; ++i)
+ result[i] = source[i];
+ return result;
+ }
+
+ //! Clones an xml_node and its hierarchy of child nodes and attributes.
+ //! Nodes and attributes are allocated from this memory pool.
+ //! Names and values are not cloned, they are shared between the clone and the source.
+ //! Result node can be optionally specified as a second parameter,
+ //! in which case its contents will be replaced with cloned source node.
+ //! This is useful when you want to clone entire document.
+ //! \param source Node to clone.
+ //! \param result Node to put results in, or 0 to automatically allocate result node
+ //! \return Pointer to cloned node. This pointer will never be NULL.
+ xml_node<Ch> *clone_node(const xml_node<Ch> *source, xml_node<Ch> *result = 0)
+ {
+ // Prepare result node
+ if (result)
+ {
+ result->remove_all_attributes();
+ result->remove_all_nodes();
+ result->type(source->type());
+ }
+ else
+ result = allocate_node(source->type());
+
+ // Clone name and value
+ result->name(source->name(), source->name_size());
+ result->value(source->value(), source->value_size());
+
+ // Clone child nodes and attributes
+ for (xml_node<Ch> *child = source->first_node(); child; child = child->next_sibling())
+ result->append_node(clone_node(child));
+ for (xml_attribute<Ch> *attr = source->first_attribute(); attr; attr = attr->next_attribute())
+ result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size()));
+
+ return result;
+ }
+
+ //! Clears the pool.
+ //! This causes memory occupied by nodes allocated by the pool to be freed.
+ //! Any nodes or strings allocated from the pool will no longer be valid.
+ void clear()
+ {
+ while (m_begin != m_static_memory)
+ {
+ char *previous_begin = reinterpret_cast<header *>(align(m_begin))->previous_begin;
+ if (m_free_func)
+ m_free_func(m_begin);
+ else
+ delete[] m_begin;
+ m_begin = previous_begin;
+ }
+ init();
+ }
+
+ //! Sets or resets the user-defined memory allocation functions for the pool.
+ //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined.
+ //! Allocation function must not return invalid pointer on failure. It should either throw,
+ //! stop the program, or use <code>longjmp()</code> function to pass control to other place of program.
+ //! If it returns invalid pointer, results are undefined.
+ //! <br><br>
+ //! User defined allocation functions must have the following forms:
+ //! <br><code>
+ //! <br>void *allocate(std::size_t size);
+ //! <br>void free(void *pointer);
+ //! </code><br>
+ //! \param af Allocation function, or 0 to restore default function
+ //! \param ff Free function, or 0 to restore default function
+ void set_allocator(alloc_func *af, free_func *ff)
+ {
+ assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet
+ m_alloc_func = af;
+ m_free_func = ff;
+ }
+
+ private:
+
+ struct header
+ {
+ char *previous_begin;
+ };
+
+ void init()
+ {
+ m_begin = m_static_memory;
+ m_ptr = align(m_begin);
+ m_end = m_static_memory + sizeof(m_static_memory);
+ }
+
+ char *align(char *ptr)
+ {
+ std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1));
+ return ptr + alignment;
+ }
+
+ char *allocate_raw(std::size_t size)
+ {
+ // Allocate
+ void *memory;
+ if (m_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[]
+ {
+ memory = m_alloc_func(size);
+ assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp
+ }
+ else
+ {
+ memory = new char[size];
+#ifdef RAPIDXML_NO_EXCEPTIONS
+ if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc
+ RAPIDXML_PARSE_ERROR("out of memory", 0);
+#endif
+ }
+ return static_cast<char *>(memory);
+ }
+
+ void *allocate_aligned(std::size_t size)
+ {
+ // Calculate aligned pointer
+ char *result = align(m_ptr);
+
+ // If not enough memory left in current pool, allocate a new pool
+ if (result + size > m_end)
+ {
+ // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE)
+ std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE;
+ if (pool_size < size)
+ pool_size = size;
+
+ // Allocate
+ std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation
+ char *raw_memory = allocate_raw(alloc_size);
+
+ // Setup new pool in allocated memory
+ char *pool = align(raw_memory);
+ header *new_header = reinterpret_cast<header *>(pool);
+ new_header->previous_begin = m_begin;
+ m_begin = raw_memory;
+ m_ptr = pool + sizeof(header);
+ m_end = raw_memory + alloc_size;
+
+ // Calculate aligned pointer again using new pool
+ result = align(m_ptr);
+ }
+
+ // Update pool and return aligned pointer
+ m_ptr = result + size;
+ return result;
+ }
+
+ char *m_begin; // Start of raw memory making up current pool
+ char *m_ptr; // First free byte in current pool
+ char *m_end; // One past last available byte in current pool
+ char m_static_memory[RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory
+ alloc_func *m_alloc_func; // Allocator function, or 0 if default is to be used
+ free_func *m_free_func; // Free function, or 0 if default is to be used
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // XML base
+
+ //! Base class for xml_node and xml_attribute implementing common functions:
+ //! name(), name_size(), value(), value_size() and parent().
+ //! \param Ch Character type to use
+ template<class Ch = char>
+ class xml_base
+ {
+
+ public:
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Construction & destruction
+
+ // Construct a base with empty name, value and parent
+ xml_base()
+ : m_name(0)
+ , m_value(0)
+ , m_parent(0)
+ {
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Node data access
+
+ //! Gets name of the node.
+ //! Interpretation of name depends on type of node.
+ //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
+ //! <br><br>
+ //! Use name_size() function to determine length of the name.
+ //! \return Name of node, or empty string if node has no name.
+ Ch *name() const
+ {
+ return m_name ? m_name : nullstr();
+ }
+
+ //! Gets size of node name, not including terminator character.
+ //! This function works correctly irrespective of whether name is or is not zero terminated.
+ //! \return Size of node name, in characters.
+ std::size_t name_size() const
+ {
+ return m_name ? m_name_size : 0;
+ }
+
+ //! Gets value of node.
+ //! Interpretation of value depends on type of node.
+ //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
+ //! <br><br>
+ //! Use value_size() function to determine length of the value.
+ //! \return Value of node, or empty string if node has no value.
+ Ch *value() const
+ {
+ return m_value ? m_value : nullstr();
+ }
+
+ //! Gets size of node value, not including terminator character.
+ //! This function works correctly irrespective of whether value is or is not zero terminated.
+ //! \return Size of node value, in characters.
+ std::size_t value_size() const
+ {
+ return m_value ? m_value_size : 0;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Node modification
+
+ //! Sets name of node to a non zero-terminated string.
+ //! See \ref ownership_of_strings.
+ //! <br><br>
+ //! Note that node does not own its name or value, it only stores a pointer to it.
+ //! It will not delete or otherwise free the pointer on destruction.
+ //! It is reponsibility of the user to properly manage lifetime of the string.
+ //! The easiest way to achieve it is to use memory_pool of the document to allocate the string -
+ //! on destruction of the document the string will be automatically freed.
+ //! <br><br>
+ //! Size of name must be specified separately, because name does not have to be zero terminated.
+ //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).
+ //! \param name Name of node to set. Does not have to be zero terminated.
+ //! \param size Size of name, in characters. This does not include zero terminator, if one is present.
+ void name(const Ch *name, std::size_t size)
+ {
+ m_name = const_cast<Ch *>(name);
+ m_name_size = size;
+ }
+
+ //! Sets name of node to a zero-terminated string.
+ //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t).
+ //! \param name Name of node to set. Must be zero terminated.
+ void name(const Ch *name)
+ {
+ this->name(name, internal::measure(name));
+ }
+
+ //! Sets value of node to a non zero-terminated string.
+ //! See \ref ownership_of_strings.
+ //! <br><br>
+ //! Note that node does not own its name or value, it only stores a pointer to it.
+ //! It will not delete or otherwise free the pointer on destruction.
+ //! It is reponsibility of the user to properly manage lifetime of the string.
+ //! The easiest way to achieve it is to use memory_pool of the document to allocate the string -
+ //! on destruction of the document the string will be automatically freed.
+ //! <br><br>
+ //! Size of value must be specified separately, because it does not have to be zero terminated.
+ //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated).
+ //! <br><br>
+ //! If an element has a child node of type node_data, it will take precedence over element value when printing.
+ //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.
+ //! \param value value of node to set. Does not have to be zero terminated.
+ //! \param size Size of value, in characters. This does not include zero terminator, if one is present.
+ void value(const Ch *value, std::size_t size)
+ {
+ m_value = const_cast<Ch *>(value);
+ m_value_size = size;
+ }
+
+ //! Sets value of node to a zero-terminated string.
+ //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t).
+ //! \param value Vame of node to set. Must be zero terminated.
+ void value(const Ch *value)
+ {
+ this->value(value, internal::measure(value));
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Related nodes access
+
+ //! Gets node parent.
+ //! \return Pointer to parent node, or 0 if there is no parent.
+ xml_node<Ch> *parent() const
+ {
+ return m_parent;
+ }
+
+ protected:
+
+ // Return empty string
+ static Ch *nullstr()
+ {
+ static Ch zero = Ch('\0');
+ return &zero;
+ }
+
+ Ch *m_name; // Name of node, or 0 if no name
+ Ch *m_value; // Value of node, or 0 if no value
+ std::size_t m_name_size; // Length of node name, or undefined of no name
+ std::size_t m_value_size; // Length of node value, or undefined if no value
+ xml_node<Ch> *m_parent; // Pointer to parent node, or 0 if none
+
+ };
+
+ //! Class representing attribute node of XML document.
+ //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base).
+ //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing.
+ //! Thus, this text must persist in memory for the lifetime of attribute.
+ //! \param Ch Character type to use.
+ template<class Ch = char>
+ class xml_attribute: public xml_base<Ch>
+ {
+
+ friend class xml_node<Ch>;
+
+ public:
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Construction & destruction
+
+ //! Constructs an empty attribute with the specified type.
+ //! Consider using memory_pool of appropriate xml_document if allocating attributes manually.
+ xml_attribute()
+ {
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Related nodes access
+
+ //! Gets document of which attribute is a child.
+ //! \return Pointer to document that contains this attribute, or 0 if there is no parent document.
+ xml_document<Ch> *document() const
+ {
+ if (xml_node<Ch> *node = this->parent())
+ {
+ while (node->parent())
+ node = node->parent();
+ return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
+ }
+ else
+ return 0;
+ }
+
+ //! Gets previous attribute, optionally matching attribute name.
+ //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found attribute, or 0 if not found.
+ xml_attribute<Ch> *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
+ if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+ return attribute;
+ return 0;
+ }
+ else
+ return this->m_parent ? m_prev_attribute : 0;
+ }
+
+ //! Gets next attribute, optionally matching attribute name.
+ //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found attribute, or 0 if not found.
+ xml_attribute<Ch> *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
+ if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+ return attribute;
+ return 0;
+ }
+ else
+ return this->m_parent ? m_next_attribute : 0;
+ }
+
+ private:
+
+ xml_attribute<Ch> *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero
+ xml_attribute<Ch> *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero
+
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // XML node
+
+ //! Class representing a node of XML document.
+ //! Each node may have associated name and value strings, which are available through name() and value() functions.
+ //! Interpretation of name and value depends on type of the node.
+ //! Type of node can be determined by using type() function.
+ //! <br><br>
+ //! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing.
+ //! Thus, this text must persist in the memory for the lifetime of node.
+ //! \param Ch Character type to use.
+ template<class Ch = char>
+ class xml_node: public xml_base<Ch>
+ {
+
+ public:
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Construction & destruction
+
+ //! Constructs an empty node with the specified type.
+ //! Consider using memory_pool of appropriate document to allocate nodes manually.
+ //! \param type Type of node to construct.
+ xml_node(node_type type)
+ : m_type(type)
+ , m_first_node(0)
+ , m_first_attribute(0)
+ {
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Node data access
+
+ //! Gets type of node.
+ //! \return Type of node.
+ node_type type() const
+ {
+ return m_type;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Related nodes access
+
+ //! Gets document of which node is a child.
+ //! \return Pointer to document that contains this node, or 0 if there is no parent document.
+ xml_document<Ch> *document() const
+ {
+ xml_node<Ch> *node = const_cast<xml_node<Ch> *>(this);
+ while (node->parent())
+ node = node->parent();
+ return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
+ }
+
+ //! Gets first child node, optionally matching node name.
+ //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found child, or 0 if not found.
+ xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
+ if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
+ return child;
+ return 0;
+ }
+ else
+ return m_first_node;
+ }
+
+ //! Gets last child node, optionally matching node name.
+ //! Behaviour is undefined if node has no children.
+ //! Use first_node() to test if node has children.
+ //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found child, or 0 if not found.
+ xml_node<Ch> *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ assert(m_first_node); // Cannot query for last child if node has no children
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_node<Ch> *child = m_last_node; child; child = child->previous_sibling())
+ if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
+ return child;
+ return 0;
+ }
+ else
+ return m_last_node;
+ }
+
+ //! Gets previous sibling node, optionally matching node name.
+ //! Behaviour is undefined if node has no parent.
+ //! Use parent() to test if node has a parent.
+ //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found sibling, or 0 if not found.
+ xml_node<Ch> *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ assert(this->m_parent); // Cannot query for siblings if node has no parent
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_node<Ch> *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
+ if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
+ return sibling;
+ return 0;
+ }
+ else
+ return m_prev_sibling;
+ }
+
+ //! Gets next sibling node, optionally matching node name.
+ //! Behaviour is undefined if node has no parent.
+ //! Use parent() to test if node has a parent.
+ //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found sibling, or 0 if not found.
+ xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ assert(this->m_parent); // Cannot query for siblings if node has no parent
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
+ if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
+ return sibling;
+ return 0;
+ }
+ else
+ return m_next_sibling;
+ }
+
+ //! Gets first attribute of node, optionally matching attribute name.
+ //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found attribute, or 0 if not found.
+ xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
+ if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+ return attribute;
+ return 0;
+ }
+ else
+ return m_first_attribute;
+ }
+
+ //! Gets last attribute of node, optionally matching attribute name.
+ //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+ //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+ //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+ //! \return Pointer to found attribute, or 0 if not found.
+ xml_attribute<Ch> *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+ {
+ if (name)
+ {
+ if (name_size == 0)
+ name_size = internal::measure(name);
+ for (xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
+ if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+ return attribute;
+ return 0;
+ }
+ else
+ return m_first_attribute ? m_last_attribute : 0;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Node modification
+
+ //! Sets type of node.
+ //! \param type Type of node to set.
+ void type(node_type type)
+ {
+ m_type = type;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Node manipulation
+
+ //! Prepends a new child node.
+ //! The prepended child becomes the first child, and all existing children are moved one position back.
+ //! \param child Node to prepend.
+ void prepend_node(xml_node<Ch> *child)
+ {
+ assert(child && !child->parent() && child->type() != node_document);
+ if (first_node())
+ {
+ child->m_next_sibling = m_first_node;
+ m_first_node->m_prev_sibling = child;
+ }
+ else
+ {
+ child->m_next_sibling = 0;
+ m_last_node = child;
+ }
+ m_first_node = child;
+ child->m_parent = this;
+ child->m_prev_sibling = 0;
+ }
+
+ //! Appends a new child node.
+ //! The appended child becomes the last child.
+ //! \param child Node to append.
+ void append_node(xml_node<Ch> *child)
+ {
+ assert(child && !child->parent() && child->type() != node_document);
+ if (first_node())
+ {
+ child->m_prev_sibling = m_last_node;
+ m_last_node->m_next_sibling = child;
+ }
+ else
+ {
+ child->m_prev_sibling = 0;
+ m_first_node = child;
+ }
+ m_last_node = child;
+ child->m_parent = this;
+ child->m_next_sibling = 0;
+ }
+
+ //! Inserts a new child node at specified place inside the node.
+ //! All children after and including the specified node are moved one position back.
+ //! \param where Place where to insert the child, or 0 to insert at the back.
+ //! \param child Node to insert.
+ void insert_node(xml_node<Ch> *where, xml_node<Ch> *child)
+ {
+ assert(!where || where->parent() == this);
+ assert(child && !child->parent() && child->type() != node_document);
+ if (where == m_first_node)
+ prepend_node(child);
+ else if (where == 0)
+ append_node(child);
+ else
+ {
+ child->m_prev_sibling = where->m_prev_sibling;
+ child->m_next_sibling = where;
+ where->m_prev_sibling->m_next_sibling = child;
+ where->m_prev_sibling = child;
+ child->m_parent = this;
+ }
+ }
+
+ //! Removes first child node.
+ //! If node has no children, behaviour is undefined.
+ //! Use first_node() to test if node has children.
+ void remove_first_node()
+ {
+ assert(first_node());
+ xml_node<Ch> *child = m_first_node;
+ m_first_node = child->m_next_sibling;
+ if (child->m_next_sibling)
+ child->m_next_sibling->m_prev_sibling = 0;
+ else
+ m_last_node = 0;
+ child->m_parent = 0;
+ }
+
+ //! Removes last child of the node.
+ //! If node has no children, behaviour is undefined.
+ //! Use first_node() to test if node has children.
+ void remove_last_node()
+ {
+ assert(first_node());
+ xml_node<Ch> *child = m_last_node;
+ if (child->m_prev_sibling)
+ {
+ m_last_node = child->m_prev_sibling;
+ child->m_prev_sibling->m_next_sibling = 0;
+ }
+ else
+ m_first_node = 0;
+ child->m_parent = 0;
+ }
+
+ //! Removes specified child from the node
+ // \param where Pointer to child to be removed.
+ void remove_node(xml_node<Ch> *where)
+ {
+ assert(where && where->parent() == this);
+ assert(first_node());
+ if (where == m_first_node)
+ remove_first_node();
+ else if (where == m_last_node)
+ remove_last_node();
+ else
+ {
+ where->m_prev_sibling->m_next_sibling = where->m_next_sibling;
+ where->m_next_sibling->m_prev_sibling = where->m_prev_sibling;
+ where->m_parent = 0;
+ }
+ }
+
+ //! Removes all child nodes (but not attributes).
+ void remove_all_nodes()
+ {
+ for (xml_node<Ch> *node = first_node(); node; node = node->m_next_sibling)
+ node->m_parent = 0;
+ m_first_node = 0;
+ }
+
+ //! Prepends a new attribute to the node.
+ //! \param attribute Attribute to prepend.
+ void prepend_attribute(xml_attribute<Ch> *attribute)
+ {
+ assert(attribute && !attribute->parent());
+ if (first_attribute())
+ {
+ attribute->m_next_attribute = m_first_attribute;
+ m_first_attribute->m_prev_attribute = attribute;
+ }
+ else
+ {
+ attribute->m_next_attribute = 0;
+ m_last_attribute = attribute;
+ }
+ m_first_attribute = attribute;
+ attribute->m_parent = this;
+ attribute->m_prev_attribute = 0;
+ }
+
+ //! Appends a new attribute to the node.
+ //! \param attribute Attribute to append.
+ void append_attribute(xml_attribute<Ch> *attribute)
+ {
+ assert(attribute && !attribute->parent());
+ if (first_attribute())
+ {
+ attribute->m_prev_attribute = m_last_attribute;
+ m_last_attribute->m_next_attribute = attribute;
+ }
+ else
+ {
+ attribute->m_prev_attribute = 0;
+ m_first_attribute = attribute;
+ }
+ m_last_attribute = attribute;
+ attribute->m_parent = this;
+ attribute->m_next_attribute = 0;
+ }
+
+ //! Inserts a new attribute at specified place inside the node.
+ //! All attributes after and including the specified attribute are moved one position back.
+ //! \param where Place where to insert the attribute, or 0 to insert at the back.
+ //! \param attribute Attribute to insert.
+ void insert_attribute(xml_attribute<Ch> *where, xml_attribute<Ch> *attribute)
+ {
+ assert(!where || where->parent() == this);
+ assert(attribute && !attribute->parent());
+ if (where == m_first_attribute)
+ prepend_attribute(attribute);
+ else if (where == 0)
+ append_attribute(attribute);
+ else
+ {
+ attribute->m_prev_attribute = where->m_prev_attribute;
+ attribute->m_next_attribute = where;
+ where->m_prev_attribute->m_next_attribute = attribute;
+ where->m_prev_attribute = attribute;
+ attribute->m_parent = this;
+ }
+ }
+
+ //! Removes first attribute of the node.
+ //! If node has no attributes, behaviour is undefined.
+ //! Use first_attribute() to test if node has attributes.
+ void remove_first_attribute()
+ {
+ assert(first_attribute());
+ xml_attribute<Ch> *attribute = m_first_attribute;
+ if (attribute->m_next_attribute)
+ {
+ attribute->m_next_attribute->m_prev_attribute = 0;
+ }
+ else
+ m_last_attribute = 0;
+ attribute->m_parent = 0;
+ m_first_attribute = attribute->m_next_attribute;
+ }
+
+ //! Removes last attribute of the node.
+ //! If node has no attributes, behaviour is undefined.
+ //! Use first_attribute() to test if node has attributes.
+ void remove_last_attribute()
+ {
+ assert(first_attribute());
+ xml_attribute<Ch> *attribute = m_last_attribute;
+ if (attribute->m_prev_attribute)
+ {
+ attribute->m_prev_attribute->m_next_attribute = 0;
+ m_last_attribute = attribute->m_prev_attribute;
+ }
+ else
+ m_first_attribute = 0;
+ attribute->m_parent = 0;
+ }
+
+ //! Removes specified attribute from node.
+ //! \param where Pointer to attribute to be removed.
+ void remove_attribute(xml_attribute<Ch> *where)
+ {
+ assert(first_attribute() && where->parent() == this);
+ if (where == m_first_attribute)
+ remove_first_attribute();
+ else if (where == m_last_attribute)
+ remove_last_attribute();
+ else
+ {
+ where->m_prev_attribute->m_next_attribute = where->m_next_attribute;
+ where->m_next_attribute->m_prev_attribute = where->m_prev_attribute;
+ where->m_parent = 0;
+ }
+ }
+
+ //! Removes all attributes of node.
+ void remove_all_attributes()
+ {
+ for (xml_attribute<Ch> *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute)
+ attribute->m_parent = 0;
+ m_first_attribute = 0;
+ }
+
+ private:
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Restrictions
+
+ // No copying
+ xml_node(const xml_node &);
+ void operator =(const xml_node &);
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Data members
+
+ // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0.
+ // This is required for maximum performance, as it allows the parser to omit initialization of
+ // unneded/redundant values.
+ //
+ // The rules are as follows:
+ // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively
+ // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage
+ // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage
+
+ node_type m_type; // Type of node; always valid
+ xml_node<Ch> *m_first_node; // Pointer to first child node, or 0 if none; always valid
+ xml_node<Ch> *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero
+ xml_attribute<Ch> *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid
+ xml_attribute<Ch> *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero
+ xml_node<Ch> *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero
+ xml_node<Ch> *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero
+
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // XML document
+
+ //! This class represents root of the DOM hierarchy.
+ //! It is also an xml_node and a memory_pool through public inheritance.
+ //! Use parse() function to build a DOM tree from a zero-terminated XML text string.
+ //! parse() function allocates memory for nodes and attributes by using functions of xml_document,
+ //! which are inherited from memory_pool.
+ //! To access root node of the document, use the document itself, as if it was an xml_node.
+ //! \param Ch Character type to use.
+ template<class Ch = char>
+ class xml_document: public xml_node<Ch>, public memory_pool<Ch>
+ {
+
+ public:
+
+ //! Constructs empty XML document
+ xml_document()
+ : xml_node<Ch>(node_document)
+ {
+ }
+
+ //! Parses zero-terminated XML string according to given flags.
+ //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used.
+ //! The string must persist for the lifetime of the document.
+ //! In case of error, rapidxml::parse_error exception will be thrown.
+ //! <br><br>
+ //! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning.
+ //! Make sure that data is zero-terminated.
+ //! <br><br>
+ //! Document can be parsed into multiple times.
+ //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool.
+ //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser.
+ template<int Flags>
+ void parse(Ch *text)
+ {
+ assert(text);
+
+ // Remove current contents
+ this->remove_all_nodes();
+ this->remove_all_attributes();
+
+ // Parse BOM, if any
+ parse_bom<Flags>(text);
+
+ // Parse children
+ while (1)
+ {
+ // Skip whitespace before node
+ skip<whitespace_pred, Flags>(text);
+ if (*text == 0)
+ break;
+
+ // Parse and append new child
+ if (*text == Ch('<'))
+ {
+ ++text; // Skip '<'
+ if (xml_node<Ch> *node = parse_node<Flags>(text))
+ this->append_node(node);
+ }
+ else
+ RAPIDXML_PARSE_ERROR("expected <", text);
+ }
+
+ }
+
+ //! Clears the document by deleting all nodes and clearing the memory pool.
+ //! All nodes owned by document pool are destroyed.
+ void clear()
+ {
+ this->remove_all_nodes();
+ this->remove_all_attributes();
+ memory_pool<Ch>::clear();
+ }
+
+ private:
+
+ ///////////////////////////////////////////////////////////////////////
+ // Internal character utility functions
+
+ // Detect whitespace character
+ struct whitespace_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_whitespace[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect node name character
+ struct node_name_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_node_name[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect attribute name character
+ struct attribute_name_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_attribute_name[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect text character (PCDATA)
+ struct text_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_text[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect text character (PCDATA) that does not require processing
+ struct text_pure_no_ws_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect text character (PCDATA) that does not require processing
+ struct text_pure_with_ws_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast<unsigned char>(ch)];
+ }
+ };
+
+ // Detect attribute value character
+ template<Ch Quote>
+ struct attribute_value_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ if (Quote == Ch('\''))
+ return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast<unsigned char>(ch)];
+ if (Quote == Ch('\"'))
+ return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast<unsigned char>(ch)];
+ return 0; // Should never be executed, to avoid warnings on Comeau
+ }
+ };
+
+ // Detect attribute value character
+ template<Ch Quote>
+ struct attribute_value_pure_pred
+ {
+ static unsigned char test(Ch ch)
+ {
+ if (Quote == Ch('\''))
+ return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast<unsigned char>(ch)];
+ if (Quote == Ch('\"'))
+ return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast<unsigned char>(ch)];
+ return 0; // Should never be executed, to avoid warnings on Comeau
+ }
+ };
+
+ // Insert coded character, using UTF8 or 8-bit ASCII
+ template<int Flags>
+ static void insert_coded_character(Ch *&text, unsigned long code)
+ {
+ if (Flags & parse_no_utf8)
+ {
+ // Insert 8-bit ASCII character
+ // Todo: possibly verify that code is less than 256 and use replacement char otherwise?
+ text[0] = static_cast<unsigned char>(code);
+ text += 1;
+ }
+ else
+ {
+ // Insert UTF8 sequence
+ if (code < 0x80) // 1 byte sequence
+ {
+ text[0] = static_cast<unsigned char>(code);
+ text += 1;
+ }
+ else if (code < 0x800) // 2 byte sequence
+ {
+ text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[0] = static_cast<unsigned char>(code | 0xC0);
+ text += 2;
+ }
+ else if (code < 0x10000) // 3 byte sequence
+ {
+ text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[0] = static_cast<unsigned char>(code | 0xE0);
+ text += 3;
+ }
+ else if (code < 0x110000) // 4 byte sequence
+ {
+ text[3] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+ text[0] = static_cast<unsigned char>(code | 0xF0);
+ text += 4;
+ }
+ else // Invalid, only codes up to 0x10FFFF are allowed in Unicode
+ {
+ RAPIDXML_PARSE_ERROR("invalid numeric character entity", text);
+ }
+ }
+ }
+
+ // Skip characters until predicate evaluates to true
+ template<class StopPred, int Flags>
+ static void skip(Ch *&text)
+ {
+ Ch *tmp = text;
+ while (StopPred::test(*tmp))
+ ++tmp;
+ text = tmp;
+ }
+
+ // Skip characters until predicate evaluates to true while doing the following:
+ // - replacing XML character entity references with proper characters (&apos; &amp; &quot; &lt; &gt; &#...;)
+ // - condensing whitespace sequences to single space character
+ template<class StopPred, class StopPredPure, int Flags>
+ static Ch *skip_and_expand_character_refs(Ch *&text)
+ {
+ // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip
+ if (Flags & parse_no_entity_translation &&
+ !(Flags & parse_normalize_whitespace) &&
+ !(Flags & parse_trim_whitespace))
+ {
+ skip<StopPred, Flags>(text);
+ return text;
+ }
+
+ // Use simple skip until first modification is detected
+ skip<StopPredPure, Flags>(text);
+
+ // Use translation skip
+ Ch *src = text;
+ Ch *dest = src;
+ while (StopPred::test(*src))
+ {
+ // If entity translation is enabled
+ if (!(Flags & parse_no_entity_translation))
+ {
+ // Test if replacement is needed
+ if (src[0] == Ch('&'))
+ {
+ switch (src[1])
+ {
+
+ // &amp; &apos;
+ case Ch('a'):
+ if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';'))
+ {
+ *dest = Ch('&');
+ ++dest;
+ src += 5;
+ continue;
+ }
+ if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';'))
+ {
+ *dest = Ch('\'');
+ ++dest;
+ src += 6;
+ continue;
+ }
+ break;
+
+ // &quot;
+ case Ch('q'):
+ if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';'))
+ {
+ *dest = Ch('"');
+ ++dest;
+ src += 6;
+ continue;
+ }
+ break;
+
+ // &gt;
+ case Ch('g'):
+ if (src[2] == Ch('t') && src[3] == Ch(';'))
+ {
+ *dest = Ch('>');
+ ++dest;
+ src += 4;
+ continue;
+ }
+ break;
+
+ // &lt;
+ case Ch('l'):
+ if (src[2] == Ch('t') && src[3] == Ch(';'))
+ {
+ *dest = Ch('<');
+ ++dest;
+ src += 4;
+ continue;
+ }
+ break;
+
+ // &#...; - assumes ASCII
+ case Ch('#'):
+ if (src[2] == Ch('x'))
+ {
+ unsigned long code = 0;
+ src += 3; // Skip &#x
+ while (1)
+ {
+ unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
+ if (digit == 0xFF)
+ break;
+ code = code * 16 + digit;
+ ++src;
+ }
+ insert_coded_character<Flags>(dest, code); // Put character in output
+ }
+ else
+ {
+ unsigned long code = 0;
+ src += 2; // Skip &#
+ while (1)
+ {
+ unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
+ if (digit == 0xFF)
+ break;
+ code = code * 10 + digit;
+ ++src;
+ }
+ insert_coded_character<Flags>(dest, code); // Put character in output
+ }
+ if (*src == Ch(';'))
+ ++src;
+ else
+ RAPIDXML_PARSE_ERROR("expected ;", src);
+ continue;
+
+ // Something else
+ default:
+ // Ignore, just copy '&' verbatim
+ break;
+
+ }
+ }
+ }
+
+ // If whitespace condensing is enabled
+ if (Flags & parse_normalize_whitespace)
+ {
+ // Test if condensing is needed
+ if (whitespace_pred::test(*src))
+ {
+ *dest = Ch(' '); ++dest; // Put single space in dest
+ ++src; // Skip first whitespace char
+ // Skip remaining whitespace chars
+ while (whitespace_pred::test(*src))
+ ++src;
+ continue;
+ }
+ }
+
+ // No replacement, only copy character
+ *dest++ = *src++;
+
+ }
+
+ // Return new end
+ text = src;
+ return dest;
+
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // Internal parsing functions
+
+ // Parse BOM, if any
+ template<int Flags>
+ void parse_bom(Ch *&text)
+ {
+ // UTF-8?
+ if (static_cast<unsigned char>(text[0]) == 0xEF &&
+ static_cast<unsigned char>(text[1]) == 0xBB &&
+ static_cast<unsigned char>(text[2]) == 0xBF)
+ {
+ text += 3; // Skup utf-8 bom
+ }
+ }
+
+ // Parse XML declaration (<?xml...)
+ template<int Flags>
+ xml_node<Ch> *parse_xml_declaration(Ch *&text)
+ {
+ // If parsing of declaration is disabled
+ if (!(Flags & parse_declaration_node))
+ {
+ // Skip until end of declaration
+ while (text[0] != Ch('?') || text[1] != Ch('>'))
+ {
+ if (!text[0])
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+ text += 2; // Skip '?>'
+ return 0;
+ }
+
+ // Create declaration
+ xml_node<Ch> *declaration = this->allocate_node(node_declaration);
+
+ // Skip whitespace before attributes or ?>
+ skip<whitespace_pred, Flags>(text);
+
+ // Parse declaration attributes
+ parse_node_attributes<Flags>(text, declaration);
+
+ // Skip ?>
+ if (text[0] != Ch('?') || text[1] != Ch('>'))
+ RAPIDXML_PARSE_ERROR("expected ?>", text);
+ text += 2;
+
+ return declaration;
+ }
+
+ // Parse XML comment (<!--...)
+ template<int Flags>
+ xml_node<Ch> *parse_comment(Ch *&text)
+ {
+ // If parsing of comments is disabled
+ if (!(Flags & parse_comment_nodes))
+ {
+ // Skip until end of comment
+ while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
+ {
+ if (!text[0])
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+ text += 3; // Skip '-->'
+ return 0; // Do not produce comment node
+ }
+
+ // Remember value start
+ Ch *value = text;
+
+ // Skip until end of comment
+ while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
+ {
+ if (!text[0])
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+
+ // Create comment node
+ xml_node<Ch> *comment = this->allocate_node(node_comment);
+ comment->value(value, text - value);
+
+ // Place zero terminator after comment value
+ if (!(Flags & parse_no_string_terminators))
+ *text = Ch('\0');
+
+ text += 3; // Skip '-->'
+ return comment;
+ }
+
+ // Parse DOCTYPE
+ template<int Flags>
+ xml_node<Ch> *parse_doctype(Ch *&text)
+ {
+ // Remember value start
+ Ch *value = text;
+
+ // Skip to >
+ while (*text != Ch('>'))
+ {
+ // Determine character type
+ switch (*text)
+ {
+
+ // If '[' encountered, scan for matching ending ']' using naive algorithm with depth
+ // This works for all W3C test files except for 2 most wicked
+ case Ch('['):
+ {
+ ++text; // Skip '['
+ int depth = 1;
+ while (depth > 0)
+ {
+ switch (*text)
+ {
+ case Ch('['): ++depth; break;
+ case Ch(']'): --depth; break;
+ case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ }
+ ++text;
+ }
+ break;
+ }
+
+ // Error on end of text
+ case Ch('\0'):
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+
+ // Other character, skip it
+ default:
+ ++text;
+
+ }
+ }
+
+ // If DOCTYPE nodes enabled
+ if (Flags & parse_doctype_node)
+ {
+ // Create a new doctype node
+ xml_node<Ch> *doctype = this->allocate_node(node_doctype);
+ doctype->value(value, text - value);
+
+ // Place zero terminator after value
+ if (!(Flags & parse_no_string_terminators))
+ *text = Ch('\0');
+
+ text += 1; // skip '>'
+ return doctype;
+ }
+ else
+ {
+ text += 1; // skip '>'
+ return 0;
+ }
+
+ }
+
+ // Parse PI
+ template<int Flags>
+ xml_node<Ch> *parse_pi(Ch *&text)
+ {
+ // If creation of PI nodes is enabled
+ if (Flags & parse_pi_nodes)
+ {
+ // Create pi node
+ xml_node<Ch> *pi = this->allocate_node(node_pi);
+
+ // Extract PI target name
+ Ch *name = text;
+ skip<node_name_pred, Flags>(text);
+ if (text == name)
+ RAPIDXML_PARSE_ERROR("expected PI target", text);
+ pi->name(name, text - name);
+
+ // Skip whitespace between pi target and pi
+ skip<whitespace_pred, Flags>(text);
+
+ // Remember start of pi
+ Ch *value = text;
+
+ // Skip to '?>'
+ while (text[0] != Ch('?') || text[1] != Ch('>'))
+ {
+ if (*text == Ch('\0'))
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+
+ // Set pi value (verbatim, no entity expansion or whitespace normalization)
+ pi->value(value, text - value);
+
+ // Place zero terminator after name and value
+ if (!(Flags & parse_no_string_terminators))
+ {
+ pi->name()[pi->name_size()] = Ch('\0');
+ pi->value()[pi->value_size()] = Ch('\0');
+ }
+
+ text += 2; // Skip '?>'
+ return pi;
+ }
+ else
+ {
+ // Skip to '?>'
+ while (text[0] != Ch('?') || text[1] != Ch('>'))
+ {
+ if (*text == Ch('\0'))
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+ text += 2; // Skip '?>'
+ return 0;
+ }
+ }
+
+ // Parse and append data
+ // Return character that ends data.
+ // This is necessary because this character might have been overwritten by a terminating 0
+ template<int Flags>
+ Ch parse_and_append_data(xml_node<Ch> *node, Ch *&text, Ch *contents_start)
+ {
+ // Backup to contents start if whitespace trimming is disabled
+ if (!(Flags & parse_trim_whitespace))
+ text = contents_start;
+
+ // Skip until end of data
+ Ch *value = text, *end;
+ if (Flags & parse_normalize_whitespace)
+ end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);
+ else
+ end = skip_and_expand_character_refs<text_pred, text_pure_no_ws_pred, Flags>(text);
+
+ // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after >
+ if (Flags & parse_trim_whitespace)
+ {
+ if (Flags & parse_normalize_whitespace)
+ {
+ // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end
+ if (*(end - 1) == Ch(' '))
+ --end;
+ }
+ else
+ {
+ // Backup until non-whitespace character is found
+ while (whitespace_pred::test(*(end - 1)))
+ --end;
+ }
+ }
+
+ // If characters are still left between end and value (this test is only necessary if normalization is enabled)
+ // Create new data node
+ if (!(Flags & parse_no_data_nodes))
+ {
+ xml_node<Ch> *data = this->allocate_node(node_data);
+ data->value(value, end - value);
+ node->append_node(data);
+ }
+
+ // Add data to parent node if no data exists yet
+ if (!(Flags & parse_no_element_values))
+ if (*node->value() == Ch('\0'))
+ node->value(value, end - value);
+
+ // Place zero terminator after value
+ if (!(Flags & parse_no_string_terminators))
+ {
+ Ch ch = *text;
+ *end = Ch('\0');
+ return ch; // Return character that ends data; this is required because zero terminator overwritten it
+ }
+
+ // Return character that ends data
+ return *text;
+ }
+
+ // Parse CDATA
+ template<int Flags>
+ xml_node<Ch> *parse_cdata(Ch *&text)
+ {
+ // If CDATA is disabled
+ if (Flags & parse_no_data_nodes)
+ {
+ // Skip until end of cdata
+ while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
+ {
+ if (!text[0])
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+ text += 3; // Skip ]]>
+ return 0; // Do not produce CDATA node
+ }
+
+ // Skip until end of cdata
+ Ch *value = text;
+ while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
+ {
+ if (!text[0])
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+
+ // Create new cdata node
+ xml_node<Ch> *cdata = this->allocate_node(node_cdata);
+ cdata->value(value, text - value);
+
+ // Place zero terminator after value
+ if (!(Flags & parse_no_string_terminators))
+ *text = Ch('\0');
+
+ text += 3; // Skip ]]>
+ return cdata;
+ }
+
+ // Parse element node
+ template<int Flags>
+ xml_node<Ch> *parse_element(Ch *&text)
+ {
+ // Create element node
+ xml_node<Ch> *element = this->allocate_node(node_element);
+
+ // Extract element name
+ Ch *name = text;
+ skip<node_name_pred, Flags>(text);
+ if (text == name)
+ RAPIDXML_PARSE_ERROR("expected element name", text);
+ element->name(name, text - name);
+
+ // Skip whitespace between element name and attributes or >
+ skip<whitespace_pred, Flags>(text);
+
+ // Parse attributes, if any
+ parse_node_attributes<Flags>(text, element);
+
+ // Determine ending type
+ if (*text == Ch('>'))
+ {
+ ++text;
+ parse_node_contents<Flags>(text, element);
+ }
+ else if (*text == Ch('/'))
+ {
+ ++text;
+ if (*text != Ch('>'))
+ RAPIDXML_PARSE_ERROR("expected >", text);
+ ++text;
+ }
+ else
+ RAPIDXML_PARSE_ERROR("expected >", text);
+
+ // Place zero terminator after name
+ if (!(Flags & parse_no_string_terminators))
+ element->name()[element->name_size()] = Ch('\0');
+
+ // Return parsed element
+ return element;
+ }
+
+ // Determine node type, and parse it
+ template<int Flags>
+ xml_node<Ch> *parse_node(Ch *&text)
+ {
+ // Parse proper node type
+ switch (text[0])
+ {
+
+ // <...
+ default:
+ // Parse and append element node
+ return parse_element<Flags>(text);
+
+ // <?...
+ case Ch('?'):
+ ++text; // Skip ?
+ if ((text[0] == Ch('x') || text[0] == Ch('X')) &&
+ (text[1] == Ch('m') || text[1] == Ch('M')) &&
+ (text[2] == Ch('l') || text[2] == Ch('L')) &&
+ whitespace_pred::test(text[3]))
+ {
+ // '<?xml ' - xml declaration
+ text += 4; // Skip 'xml '
+ return parse_xml_declaration<Flags>(text);
+ }
+ else
+ {
+ // Parse PI
+ return parse_pi<Flags>(text);
+ }
+
+ // <!...
+ case Ch('!'):
+
+ // Parse proper subset of <! node
+ switch (text[1])
+ {
+
+ // <!-
+ case Ch('-'):
+ if (text[2] == Ch('-'))
+ {
+ // '<!--' - xml comment
+ text += 3; // Skip '!--'
+ return parse_comment<Flags>(text);
+ }
+ break;
+
+ // <![
+ case Ch('['):
+ if (text[2] == Ch('C') && text[3] == Ch('D') && text[4] == Ch('A') &&
+ text[5] == Ch('T') && text[6] == Ch('A') && text[7] == Ch('['))
+ {
+ // '<![CDATA[' - cdata
+ text += 8; // Skip '![CDATA['
+ return parse_cdata<Flags>(text);
+ }
+ break;
+
+ // <!D
+ case Ch('D'):
+ if (text[2] == Ch('O') && text[3] == Ch('C') && text[4] == Ch('T') &&
+ text[5] == Ch('Y') && text[6] == Ch('P') && text[7] == Ch('E') &&
+ whitespace_pred::test(text[8]))
+ {
+ // '<!DOCTYPE ' - doctype
+ text += 9; // skip '!DOCTYPE '
+ return parse_doctype<Flags>(text);
+ }
+
+ } // switch
+
+ // Attempt to skip other, unrecognized node types starting with <!
+ ++text; // Skip !
+ while (*text != Ch('>'))
+ {
+ if (*text == 0)
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+ ++text;
+ }
+ ++text; // Skip '>'
+ return 0; // No node recognized
+
+ }
+ }
+
+ // Parse contents of the node - children, data etc.
+ template<int Flags>
+ void parse_node_contents(Ch *&text, xml_node<Ch> *node)
+ {
+ // For all children and text
+ while (1)
+ {
+ // Skip whitespace between > and node contents
+ Ch *contents_start = text; // Store start of node contents before whitespace is skipped
+ skip<whitespace_pred, Flags>(text);
+ Ch next_char = *text;
+
+ // After data nodes, instead of continuing the loop, control jumps here.
+ // This is because zero termination inside parse_and_append_data() function
+ // would wreak havoc with the above code.
+ // Also, skipping whitespace after data nodes is unnecessary.
+ after_data_node:
+
+ // Determine what comes next: node closing, child node, data node, or 0?
+ switch (next_char)
+ {
+
+ // Node closing or child node
+ case Ch('<'):
+ if (text[1] == Ch('/'))
+ {
+ // Node closing
+ text += 2; // Skip '</'
+ if (Flags & parse_validate_closing_tags)
+ {
+ // Skip and validate closing tag name
+ Ch *closing_name = text;
+ skip<node_name_pred, Flags>(text);
+ if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true))
+ RAPIDXML_PARSE_ERROR("invalid closing tag name", text);
+ }
+ else
+ {
+ // No validation, just skip name
+ skip<node_name_pred, Flags>(text);
+ }
+ // Skip remaining whitespace after node name
+ skip<whitespace_pred, Flags>(text);
+ if (*text != Ch('>'))
+ RAPIDXML_PARSE_ERROR("expected >", text);
+ ++text; // Skip '>'
+ return; // Node closed, finished parsing contents
+ }
+ else
+ {
+ // Child node
+ ++text; // Skip '<'
+ if (xml_node<Ch> *child = parse_node<Flags>(text))
+ node->append_node(child);
+ }
+ break;
+
+ // End of data - error
+ case Ch('\0'):
+ RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+
+ // Data node
+ default:
+ next_char = parse_and_append_data<Flags>(node, text, contents_start);
+ goto after_data_node; // Bypass regular processing after data nodes
+
+ }
+ }
+ }
+
+ // Parse XML attributes of the node
+ template<int Flags>
+ void parse_node_attributes(Ch *&text, xml_node<Ch> *node)
+ {
+ // For all attributes
+ while (attribute_name_pred::test(*text))
+ {
+ // Extract attribute name
+ Ch *name = text;
+ ++text; // Skip first character of attribute name
+ skip<attribute_name_pred, Flags>(text);
+ if (text == name)
+ RAPIDXML_PARSE_ERROR("expected attribute name", name);
+
+ // Create new attribute
+ xml_attribute<Ch> *attribute = this->allocate_attribute();
+ attribute->name(name, text - name);
+ node->append_attribute(attribute);
+
+ // Skip whitespace after attribute name
+ skip<whitespace_pred, Flags>(text);
+
+ // Skip =
+ if (*text != Ch('='))
+ RAPIDXML_PARSE_ERROR("expected =", text);
+ ++text;
+
+ // Add terminating zero after name
+ if (!(Flags & parse_no_string_terminators))
+ attribute->name()[attribute->name_size()] = 0;
+
+ // Skip whitespace after =
+ skip<whitespace_pred, Flags>(text);
+
+ // Skip quote and remember if it was ' or "
+ Ch quote = *text;
+ if (quote != Ch('\'') && quote != Ch('"'))
+ RAPIDXML_PARSE_ERROR("expected ' or \"", text);
+ ++text;
+
+ // Extract attribute value and expand char refs in it
+ Ch *value = text, *end;
+ const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes
+ if (quote == Ch('\''))
+ end = skip_and_expand_character_refs<attribute_value_pred<Ch('\'')>, attribute_value_pure_pred<Ch('\'')>, AttFlags>(text);
+ else
+ end = skip_and_expand_character_refs<attribute_value_pred<Ch('"')>, attribute_value_pure_pred<Ch('"')>, AttFlags>(text);
+
+ // Set attribute value
+ attribute->value(value, end - value);
+
+ // Make sure that end quote is present
+ if (*text != quote)
+ RAPIDXML_PARSE_ERROR("expected ' or \"", text);
+ ++text; // Skip quote
+
+ // Add terminating zero after value
+ if (!(Flags & parse_no_string_terminators))
+ attribute->value()[attribute->value_size()] = 0;
+
+ // Skip whitespace after attribute value
+ skip<whitespace_pred, Flags>(text);
+ }
+ }
+
+ };
+
+ //! \cond internal
+ namespace internal
+ {
+
+ // Whitespace (space \n \r \t)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_whitespace[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F
+ };
+
+ // Node name (anything but space \n \r \t / > ? \0)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_node_name[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Text (i.e. PCDATA) (anything but < \0)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_text[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled
+ // (anything but < \0 &)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_text_pure_no_ws[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled
+ // (anything but < \0 & space \n \r \t)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_text_pure_with_ws[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Attribute name (anything but space \n \r \t / < > = ? ! \0)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_attribute_name[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Attribute data with single quote (anything but ' \0)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Attribute data with single quote that does not require processing (anything but ' \0 &)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1_pure[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Attribute data with double quote (anything but " \0)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Attribute data with double quote that does not require processing (anything but " \0 &)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2_pure[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1
+ 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F
+ };
+
+ // Digits (dec and hex, 255 denotes end of numeric character reference)
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_digits[256] =
+ {
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3
+ 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5
+ 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F
+ };
+
+ // Upper case conversion
+ template<int Dummy>
+ const unsigned char lookup_tables<Dummy>::lookup_upcase[256] =
+ {
+ // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5
+ 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F
+ };
+ }
+ //! \endcond
+
+}
+
+// Undefine internal macros
+#undef RAPIDXML_PARSE_ERROR
+
+// On MSVC, restore warnings state
+#ifdef _MSC_VER
+ #pragma warning(pop)
+#endif
+
+#endif

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_iterators.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_iterators.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,174 @@
+#ifndef RAPIDXML_ITERATORS_HPP_INCLUDED
+#define RAPIDXML_ITERATORS_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_iterators.hpp This file contains rapidxml iterators
+
+#include "rapidxml.hpp"
+
+namespace rapidxml
+{
+
+ //! Iterator of child nodes of xml_node
+ template<class Ch>
+ class node_iterator
+ {
+
+ public:
+
+ typedef typename xml_node<Ch> value_type;
+ typedef typename xml_node<Ch> &reference;
+ typedef typename xml_node<Ch> *pointer;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ node_iterator()
+ : m_node(0)
+ {
+ }
+
+ node_iterator(xml_node<Ch> *node)
+ : m_node(node->first_node())
+ {
+ }
+
+ reference operator *() const
+ {
+ assert(m_node);
+ return *m_node;
+ }
+
+ pointer operator->() const
+ {
+ assert(m_node);
+ return m_node;
+ }
+
+ node_iterator& operator++()
+ {
+ assert(m_node);
+ m_node = m_node->next_sibling();
+ return *this;
+ }
+
+ node_iterator operator++(int)
+ {
+ node_iterator tmp = *this;
+ ++this;
+ return tmp;
+ }
+
+ node_iterator& operator--()
+ {
+ assert(m_node && m_node->previous_sibling());
+ m_node = m_node->previous_sibling();
+ return *this;
+ }
+
+ node_iterator operator--(int)
+ {
+ node_iterator tmp = *this;
+ ++this;
+ return tmp;
+ }
+
+ bool operator ==(const node_iterator<Ch> &rhs)
+ {
+ return m_node == rhs.m_node;
+ }
+
+ bool operator !=(const node_iterator<Ch> &rhs)
+ {
+ return m_node != rhs.m_node;
+ }
+
+ private:
+
+ xml_node<Ch> *m_node;
+
+ };
+
+ //! Iterator of child attributes of xml_node
+ template<class Ch>
+ class attribute_iterator
+ {
+
+ public:
+
+ typedef typename xml_attribute<Ch> value_type;
+ typedef typename xml_attribute<Ch> &reference;
+ typedef typename xml_attribute<Ch> *pointer;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
+
+ attribute_iterator()
+ : m_attribute(0)
+ {
+ }
+
+ attribute_iterator(xml_node<Ch> *node)
+ : m_attribute(node->first_attribute())
+ {
+ }
+
+ reference operator *() const
+ {
+ assert(m_attribute);
+ return *m_attribute;
+ }
+
+ pointer operator->() const
+ {
+ assert(m_attribute);
+ return m_attribute;
+ }
+
+ attribute_iterator& operator++()
+ {
+ assert(m_attribute);
+ m_attribute = m_attribute->next_attribute();
+ return *this;
+ }
+
+ attribute_iterator operator++(int)
+ {
+ attribute_iterator tmp = *this;
+ ++this;
+ return tmp;
+ }
+
+ attribute_iterator& operator--()
+ {
+ assert(m_attribute && m_attribute->previous_attribute());
+ m_attribute = m_attribute->previous_attribute();
+ return *this;
+ }
+
+ attribute_iterator operator--(int)
+ {
+ attribute_iterator tmp = *this;
+ ++this;
+ return tmp;
+ }
+
+ bool operator ==(const attribute_iterator<Ch> &rhs)
+ {
+ return m_attribute == rhs.m_attribute;
+ }
+
+ bool operator !=(const attribute_iterator<Ch> &rhs)
+ {
+ return m_attribute != rhs.m_attribute;
+ }
+
+ private:
+
+ xml_attribute<Ch> *m_attribute;
+
+ };
+
+}
+
+#endif

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_print.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_print.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,421 @@
+#ifndef RAPIDXML_PRINT_HPP_INCLUDED
+#define RAPIDXML_PRINT_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_print.hpp This file contains rapidxml printer implementation
+
+#include "rapidxml.hpp"
+
+// Only include streams if not disabled
+#ifndef RAPIDXML_NO_STREAMS
+ #include <ostream>
+ #include <iterator>
+#endif
+
+namespace rapidxml
+{
+
+ ///////////////////////////////////////////////////////////////////////
+ // Printing flags
+
+ const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function.
+
+ ///////////////////////////////////////////////////////////////////////
+ // Internal
+
+ //! \cond internal
+ namespace internal
+ {
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Internal character operations
+
+ // Copy characters from given range to given output iterator
+ template<class OutIt, class Ch>
+ inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out)
+ {
+ while (begin != end)
+ *out++ = *begin++;
+ return out;
+ }
+
+ // Copy characters from given range to given output iterator and expand
+ // characters into references (&lt; &gt; &apos; &quot; &amp;)
+ template<class OutIt, class Ch>
+ inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out)
+ {
+ while (begin != end)
+ {
+ if (*begin == noexpand)
+ {
+ *out++ = *begin; // No expansion, copy character
+ }
+ else
+ {
+ switch (*begin)
+ {
+ case Ch('<'):
+ *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';');
+ break;
+ case Ch('>'):
+ *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';');
+ break;
+ case Ch('\''):
+ *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';');
+ break;
+ case Ch('"'):
+ *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';');
+ break;
+ case Ch('&'):
+ *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';');
+ break;
+ default:
+ *out++ = *begin; // No expansion, copy character
+ }
+ }
+ ++begin; // Step to next character
+ }
+ return out;
+ }
+
+ // Fill given output iterator with repetitions of the same character
+ template<class OutIt, class Ch>
+ inline OutIt fill_chars(OutIt out, int n, Ch ch)
+ {
+ for (int i = 0; i < n; ++i)
+ *out++ = ch;
+ return out;
+ }
+
+ // Find character
+ template<class Ch, Ch ch>
+ inline bool find_char(const Ch *begin, const Ch *end)
+ {
+ while (begin != end)
+ if (*begin++ == ch)
+ return true;
+ return false;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Internal printing operations
+
+ // Print node
+ template<class OutIt, class Ch>
+ inline OutIt print_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ // Print proper node type
+ switch (node->type())
+ {
+
+ // Document
+ case node_document:
+ out = print_children(out, node, flags, indent);
+ break;
+
+ // Element
+ case node_element:
+ out = print_element_node(out, node, flags, indent);
+ break;
+
+ // Data
+ case node_data:
+ out = print_data_node(out, node, flags, indent);
+ break;
+
+ // CDATA
+ case node_cdata:
+ out = print_cdata_node(out, node, flags, indent);
+ break;
+
+ // Declaration
+ case node_declaration:
+ out = print_declaration_node(out, node, flags, indent);
+ break;
+
+ // Comment
+ case node_comment:
+ out = print_comment_node(out, node, flags, indent);
+ break;
+
+ // Doctype
+ case node_doctype:
+ out = print_doctype_node(out, node, flags, indent);
+ break;
+
+ // Pi
+ case node_pi:
+ out = print_pi_node(out, node, flags, indent);
+ break;
+
+ // Unknown
+ default:
+ assert(0);
+ break;
+ }
+
+ // If indenting not disabled, add line break after node
+ if (!(flags & print_no_indenting))
+ *out = Ch('\n'), ++out;
+
+ // Return modified iterator
+ return out;
+ }
+
+ // Print children of the node
+ template<class OutIt, class Ch>
+ inline OutIt print_children(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ for (xml_node<Ch> *child = node->first_node(); child; child = child->next_sibling())
+ out = print_node(out, child, flags, indent);
+ return out;
+ }
+
+ // Print attributes of the node
+ template<class OutIt, class Ch>
+ inline OutIt print_attributes(OutIt out, const xml_node<Ch> *node, int flags)
+ {
+ for (xml_attribute<Ch> *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute())
+ {
+ if (attribute->name() && attribute->value())
+ {
+ // Print attribute name
+ *out = Ch(' '), ++out;
+ out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out);
+ *out = Ch('='), ++out;
+ // Print attribute value using appropriate quote type
+ if (find_char<Ch, Ch('"')>(attribute->value(), attribute->value() + attribute->value_size()))
+ {
+ *out = Ch('\''), ++out;
+ out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out);
+ *out = Ch('\''), ++out;
+ }
+ else
+ {
+ *out = Ch('"'), ++out;
+ out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out);
+ *out = Ch('"'), ++out;
+ }
+ }
+ }
+ return out;
+ }
+
+ // Print data node
+ template<class OutIt, class Ch>
+ inline OutIt print_data_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_data);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out);
+ return out;
+ }
+
+ // Print data node
+ template<class OutIt, class Ch>
+ inline OutIt print_cdata_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_cdata);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'); ++out;
+ *out = Ch('!'); ++out;
+ *out = Ch('['); ++out;
+ *out = Ch('C'); ++out;
+ *out = Ch('D'); ++out;
+ *out = Ch('A'); ++out;
+ *out = Ch('T'); ++out;
+ *out = Ch('A'); ++out;
+ *out = Ch('['); ++out;
+ out = copy_chars(node->value(), node->value() + node->value_size(), out);
+ *out = Ch(']'); ++out;
+ *out = Ch(']'); ++out;
+ *out = Ch('>'); ++out;
+ return out;
+ }
+
+ // Print element node
+ template<class OutIt, class Ch>
+ inline OutIt print_element_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_element);
+
+ // Print element name and attributes, if any
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'), ++out;
+ out = copy_chars(node->name(), node->name() + node->name_size(), out);
+ out = print_attributes(out, node, flags);
+
+ // If node is childless
+ if (node->value_size() == 0 && !node->first_node())
+ {
+ // Print childless node tag ending
+ *out = Ch('/'), ++out;
+ *out = Ch('>'), ++out;
+ }
+ else
+ {
+ // Print normal node tag ending
+ *out = Ch('>'), ++out;
+
+ // Test if node contains a single data node only (and no other nodes)
+ xml_node<Ch> *child = node->first_node();
+ if (!child)
+ {
+ // If node has no children, only print its value without indenting
+ out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out);
+ }
+ else if (child->next_sibling() == 0 && child->type() == node_data)
+ {
+ // If node has a sole data child, only print its value without indenting
+ out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out);
+ }
+ else
+ {
+ // Print all children with full indenting
+ if (!(flags & print_no_indenting))
+ *out = Ch('\n'), ++out;
+ out = print_children(out, node, flags, indent + 1);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ }
+
+ // Print node end
+ *out = Ch('<'), ++out;
+ *out = Ch('/'), ++out;
+ out = copy_chars(node->name(), node->name() + node->name_size(), out);
+ *out = Ch('>'), ++out;
+ }
+ return out;
+ }
+
+ // Print declaration node
+ template<class OutIt, class Ch>
+ inline OutIt print_declaration_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ // Print declaration start
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'), ++out;
+ *out = Ch('?'), ++out;
+ *out = Ch('x'), ++out;
+ *out = Ch('m'), ++out;
+ *out = Ch('l'), ++out;
+
+ // Print attributes
+ out = print_attributes(out, node, flags);
+
+ // Print declaration end
+ *out = Ch('?'), ++out;
+ *out = Ch('>'), ++out;
+
+ return out;
+ }
+
+ // Print comment node
+ template<class OutIt, class Ch>
+ inline OutIt print_comment_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_comment);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'), ++out;
+ *out = Ch('!'), ++out;
+ *out = Ch('-'), ++out;
+ *out = Ch('-'), ++out;
+ out = copy_chars(node->value(), node->value() + node->value_size(), out);
+ *out = Ch('-'), ++out;
+ *out = Ch('-'), ++out;
+ *out = Ch('>'), ++out;
+ return out;
+ }
+
+ // Print doctype node
+ template<class OutIt, class Ch>
+ inline OutIt print_doctype_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_doctype);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'), ++out;
+ *out = Ch('!'), ++out;
+ *out = Ch('D'), ++out;
+ *out = Ch('O'), ++out;
+ *out = Ch('C'), ++out;
+ *out = Ch('T'), ++out;
+ *out = Ch('Y'), ++out;
+ *out = Ch('P'), ++out;
+ *out = Ch('E'), ++out;
+ *out = Ch(' '), ++out;
+ out = copy_chars(node->value(), node->value() + node->value_size(), out);
+ *out = Ch('>'), ++out;
+ return out;
+ }
+
+ // Print pi node
+ template<class OutIt, class Ch>
+ inline OutIt print_pi_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+ {
+ assert(node->type() == node_pi);
+ if (!(flags & print_no_indenting))
+ out = fill_chars(out, indent, Ch('\t'));
+ *out = Ch('<'), ++out;
+ *out = Ch('?'), ++out;
+ out = copy_chars(node->name(), node->name() + node->name_size(), out);
+ *out = Ch(' '), ++out;
+ out = copy_chars(node->value(), node->value() + node->value_size(), out);
+ *out = Ch('?'), ++out;
+ *out = Ch('>'), ++out;
+ return out;
+ }
+
+ }
+ //! \endcond
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Printing
+
+ //! Prints XML to given output iterator.
+ //! \param out Output iterator to print to.
+ //! \param node Node to be printed. Pass xml_document to print entire document.
+ //! \param flags Flags controlling how XML is printed.
+ //! \return Output iterator pointing to position immediately after last character of printed text.
+ template<class OutIt, class Ch>
+ inline OutIt print(OutIt out, const xml_node<Ch> &node, int flags = 0)
+ {
+ return internal::print_node(out, &node, flags, 0);
+ }
+
+#ifndef RAPIDXML_NO_STREAMS
+
+ //! Prints XML to given output stream.
+ //! \param out Output stream to print to.
+ //! \param node Node to be printed. Pass xml_document to print entire document.
+ //! \param flags Flags controlling how XML is printed.
+ //! \return Output stream.
+ template<class Ch>
+ inline std::basic_ostream<Ch> &print(std::basic_ostream<Ch> &out, const xml_node<Ch> &node, int flags = 0)
+ {
+ print(std::ostream_iterator<Ch>(out), node, flags);
+ return out;
+ }
+
+ //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process.
+ //! \param out Output stream to print to.
+ //! \param node Node to be printed.
+ //! \return Output stream.
+ template<class Ch>
+ inline std::basic_ostream<Ch> &operator <<(std::basic_ostream<Ch> &out, const xml_node<Ch> &node)
+ {
+ return print(out, node);
+ }
+
+#endif
+
+}
+
+#endif

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_utils.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/rapidxml-1.13/rapidxml_utils.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,122 @@
+#ifndef RAPIDXML_UTILS_HPP_INCLUDED
+#define RAPIDXML_UTILS_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful
+//! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective.
+
+#include "rapidxml.hpp"
+#include <vector>
+#include <string>
+#include <fstream>
+#include <stdexcept>
+
+namespace rapidxml
+{
+
+ //! Represents data loaded from a file
+ template<class Ch = char>
+ class file
+ {
+
+ public:
+
+ //! Loads file into the memory. Data will be automatically destroyed by the destructor.
+ //! \param filename Filename to load.
+ file(const char *filename)
+ {
+ using namespace std;
+
+ // Open stream
+ basic_ifstream<Ch> stream(filename, ios::binary);
+ if (!stream)
+ throw runtime_error(string("cannot open file ") + filename);
+ stream.unsetf(ios::skipws);
+
+ // Determine stream size
+ stream.seekg(0, ios::end);
+ size_t size = stream.tellg();
+ stream.seekg(0);
+
+ // Load data and add terminating 0
+ m_data.resize(size + 1);
+ stream.read(&m_data.front(), static_cast<streamsize>(size));
+ m_data[size] = 0;
+ }
+
+ //! Loads file into the memory. Data will be automatically destroyed by the destructor
+ //! \param stream Stream to load from
+ file(std::basic_istream<Ch> &stream)
+ {
+ using namespace std;
+
+ // Load data and add terminating 0
+ stream.unsetf(ios::skipws);
+ m_data.assign(istreambuf_iterator<Ch>(stream), istreambuf_iterator<Ch>());
+ if (stream.fail() || stream.bad())
+ throw runtime_error("error reading stream");
+ m_data.push_back(0);
+ }
+
+ //! Gets file data.
+ //! \return Pointer to data of file.
+ Ch *data()
+ {
+ return &m_data.front();
+ }
+
+ //! Gets file data.
+ //! \return Pointer to data of file.
+ const Ch *data() const
+ {
+ return &m_data.front();
+ }
+
+ //! Gets file data size.
+ //! \return Size of file data, in characters.
+ std::size_t size() const
+ {
+ return m_data.size();
+ }
+
+ private:
+
+ std::vector<Ch> m_data; // File data
+
+ };
+
+ //! Counts children of node. Time complexity is O(n).
+ //! \return Number of children of node
+ template<class Ch>
+ inline std::size_t count_children(xml_node<Ch> *node)
+ {
+ xml_node<Ch> *child = node->first_node();
+ std::size_t count = 0;
+ while (child)
+ {
+ ++count;
+ child = child->next_sibling();
+ }
+ return count;
+ }
+
+ //! Counts attributes of node. Time complexity is O(n).
+ //! \return Number of attributes of node
+ template<class Ch>
+ inline std::size_t count_attributes(xml_node<Ch> *node)
+ {
+ xml_attribute<Ch> *attr = node->first_attribute();
+ std::size_t count = 0;
+ while (attr)
+ {
+ ++count;
+ attr = attr->next_attribute();
+ }
+ return count;
+ }
+
+}
+
+#endif

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/readme.txt
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/contrib/readme.txt 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,5 @@
+Download RapidXml from here
+http://rapidxml.sourceforge.net/
+
+and put the contents in the folder rapidxml-1.13
+(adapt version if necessary)

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_elements.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_elements.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,166 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef DOXYGEN_ELEMENTS_HPP
+#define DOXYGEN_ELEMENTS_HPP
+
+
+#include <string>
+#include <vector>
+
+
+enum markup_type { markup_default, markup_synopsis };
+enum markup_order_type { markup_any, markup_before, markup_after };
+
+// TODO: rename, not all are functions
+enum function_type
+{
+ function_unknown,
+ function_define,
+ function_constructor_destructor,
+ function_member,
+ function_free,
+};
+
+struct base_element
+{
+ std::string name;
+ std::string brief_description;
+
+ bool skip;
+
+ base_element(std::string const& n = "")
+ : name(n)
+ , skip(false)
+ {}
+};
+
+
+// contains (template)parameter
+struct parameter : public base_element
+{
+ std::string type;
+ std::string default_value; // for template parameters
+ std::string fulltype; // post-processed
+};
+
+struct enumeration_value : public base_element
+{
+ std::string initializer;
+};
+
+
+
+struct markup
+{
+ std::string value;
+ markup_order_type order;
+ markup_type type;
+
+ markup(std::string const& v = "")
+ : value(v)
+ , order(markup_any)
+ , type(markup_default)
+ {
+ init();
+ }
+
+ markup(markup_order_type o, markup_type t, std::string const& v = "")
+ : value(v)
+ , order(o)
+ , type(t)
+ {
+ init();
+ }
+
+ void init()
+ {
+ boost::trim(value);
+ boost::replace_all(value, "\\*", "*");
+ }
+};
+
+// Base of a class/struct, function, define
+struct element : public base_element
+{
+ std::string detailed_description;
+ std::string location;
+ int line; // To sort - Doxygen changes order - we change it back
+
+ // QBK-includes
+ // Filled with e.g.: \qbk([include reference/myqbk.qbk]}
+ std::vector<markup> qbk_markup;
+
+ // To distinguish overloads: unary, binary etc,
+ // Filled with: \qbk{distinguish,<A discerning description>}
+ std::string additional_description;
+
+ std::vector<parameter> template_parameters;
+ std::vector<parameter> parameters;
+
+ element()
+ : line(0)
+ {}
+};
+
+
+struct function : public element
+{
+ function_type type;
+ std::string definition, argsstring;
+ std::string return_type, return_description;
+
+ bool unique;
+
+ function()
+ : type(function_unknown)
+ , unique(true)
+ {}
+
+};
+
+
+struct enumeration : public element
+{
+ std::vector<enumeration_value> enumeration_values;
+};
+
+
+struct base_class
+{
+ std::string name;
+ std::string derivation; // "prot" element
+ std::string virtuality; // "virt" element
+};
+
+struct class_or_struct : public element
+{
+ bool is_class; // true if class, false if struct
+ std::string name, fullname;
+ std::vector<function> functions;
+
+ std::vector<base_element> typedefs;
+ std::vector<base_element> variables;
+
+ std::vector<base_class> base_classes;
+};
+
+
+struct documentation
+{
+ // Only one expected (no grouping)
+ class_or_struct cos;
+
+ // There can be many of them (in groups):
+ std::vector<function> functions;
+ std::vector<function> defines;
+ std::vector<enumeration> enumerations;
+};
+
+
+#endif // DOXYGEN_ELEMENTS_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,190 @@
+// doxml2qbk (developed in the context of Boost.Geometry documentation)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+// Barend Gehrels, Aug 1, 2010
+// In continuation of the QuickBook documentation of Boost.Geometry
+//
+// Converts XML files created by Doxygen to Quickbook
+// Notes:
+// - basically generic, but implemented with Boost.Geometry in mind
+// - makes use of some specific XML elements, which can be created by Doxygen
+// using /xmlonly
+// currently this is the element <qbk.example> which will make a reference
+// to an example.
+// - currently still in draft
+
+// Aug 14/15: added classes, defines, various enhancements.
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <vector>
+#include <map>
+
+#include <boost/foreach.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/split.hpp>
+
+
+#include <boost/program_options.hpp>
+
+#include <rapidxml.hpp>
+
+#include <configuration.hpp>
+#include <file_to_string.hpp>
+#include <doxygen_elements.hpp>
+#include <doxygen_xml_parser.hpp>
+#include <parameter_predicates.hpp>
+#include <quickbook_output.hpp>
+#include <rapidxml_util.hpp>
+
+
+
+int main(int argc, char** argv)
+{
+ std::string filename;
+ try
+ {
+ configuration config;
+ std::string copyright_filename;
+
+ // Read/get configuration
+ {
+ namespace po = boost::program_options;
+ po::options_description description("=== doxml2qbk ===\nAllowed options");
+
+
+ std::string convenience_headers;
+
+ description.add_options()
+ ("help", "Help message")
+ ("xml", po::value<std::string>(&filename),
+ "Name of XML file written by Doxygen")
+ ("start_include", po::value<std::string>(&config.start_include),
+ "Start include")
+ ("convenience_header_path", po::value<std::string>(&config.convenience_header_path),
+ "Convenience header path")
+ ("convenience_headers", po::value<std::string>(&convenience_headers),
+ "Convenience header(s) (comma-separated)")
+ ("skip_namespace", po::value<std::string>(&config.skip_namespace),
+ "Namespace to skip (e.g. boost::mylib::")
+ ("copyright", po::value<std::string>(&copyright_filename),
+ "Name of QBK file including (commented) copyright and license")
+ ;
+
+ po::variables_map varmap;
+
+ if (argc == 2 && ! boost::starts_with(argv[1], "--"))
+ {
+ // (especially for debugging) options might go into an INI file
+ std::ifstream config_file (argv[1], std::ifstream::in);
+ po::store(po::parse_config_file(config_file, description), varmap);
+ }
+ else
+ {
+ po::store(po::parse_command_line(argc, argv, description), varmap);
+ }
+
+ po::notify(varmap);
+
+ if (varmap.count("help") || filename.empty())
+ {
+ std::cout << description << std::endl;
+ return 1;
+ }
+
+ // Split CSV with headerfile names into configuration
+ if (! convenience_headers.empty())
+ {
+ boost::split(config.convenience_headers, convenience_headers, boost::is_any_of(","));
+ }
+ }
+
+ // Read files into strings
+ std::string xml_string = file_to_string(filename);
+ std::string license = copyright_filename.empty()
+ ? ""
+ : file_to_string(copyright_filename);
+
+ // Parse the XML outputted by Doxygen
+ xml_doc xml(xml_string.c_str());
+
+ documentation doc;
+ parse(xml.first_node(), config, doc);
+
+ // Check for duplicate function names
+ for (std::size_t i = 0; i < doc.functions.size(); i++)
+ {
+ function& f1 = doc.functions[i];
+ for (std::size_t j = i + 1; j < doc.functions.size(); j++)
+ {
+ function& f2 = doc.functions[j];
+
+ if (f1.name == f2.name)
+ {
+ // It is not a unique function, so e.g. an overload,
+ // so a description must distinguish them.
+ // Difference is either the number of parameters, or a const / non-const version
+ // Use the "\qbk{distinguish,with strategy}" in the source code to distinguish
+ f1.unique = false;
+ f2.unique = false;
+ }
+ }
+ }
+
+
+ // Write copyright/license (keep inspect silent)
+ if (! license.empty())
+ {
+ std::cout << license << std::endl;
+ }
+
+ // Write warning comment
+ std::cout
+ << "[/ Generated by doxygen_xml2qbk, don't change, will be overwritten automatically]" << std::endl
+ << "[/ Generated from " << filename << "]" << std::endl;
+
+ // Write the rest: functions, defines, classes or structs
+ BOOST_FOREACH(function const& f, doc.functions)
+ {
+ quickbook_output(f, config, std::cout, int());
+ }
+ BOOST_FOREACH(function const& f, doc.defines)
+ {
+ quickbook_output(f, config, std::cout, int());
+ }
+ BOOST_FOREACH(enumeration const& e, doc.enumerations)
+ {
+ quickbook_output(e, config, std::cout, int());
+ }
+
+ if (! doc.cos.name.empty())
+ {
+ std::sort(doc.cos.functions.begin(), doc.cos.functions.end(), sort_on_line<function>());
+ quickbook_output(doc.cos, config, std::cout, quickbook_output_cos_alt());
+ }
+
+ }
+ catch(std::exception const& e)
+ {
+ std::cerr << "Exception in doxygen_xml2qbk: " << std::endl
+ << " Message: " << e.what() << std::endl
+ << " File: " << filename << std::endl
+ << " Type: " << typeid(e).name() << std::endl
+ << std::endl;
+ return 1;
+ }
+ catch(...)
+ {
+ std::cerr << "Unknown exception in doxygen_xml2qbk"
+ << std::endl;
+ return 1;
+ }
+ return 0;
+}
+

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml2qbk.suo
==============================================================================
Binary file. No diff available.

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,596 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef DOXYGEN_XML_PARSER_HPP
+#define DOXYGEN_XML_PARSER_HPP
+
+
+#include <string>
+#include <vector>
+
+#include <boost/algorithm/string.hpp>
+
+#include <rapidxml_util.hpp>
+#include <doxygen_elements.hpp>
+#include <parameter_predicates.hpp>
+#include <configuration.hpp>
+
+
+inline std::string keep_after(std::string const& input, std::string const& sig)
+{
+ std::size_t pos = input.rfind(sig);
+ if (pos != std::string::npos)
+ {
+ std::string copy = input.substr(pos + sig.length());
+ return copy;
+ }
+ return input;
+}
+
+
+static inline void add_or_set(std::vector<parameter>& parameters, parameter const& p)
+{
+ std::vector<parameter>::iterator it = std::find_if(parameters.begin(), parameters.end(), par_by_name(p.name));
+ if (it != parameters.end())
+ {
+ if (it->brief_description.empty()) it->brief_description = p.brief_description;
+ if (it->type.empty()) it->type = p.type;
+ if (it->fulltype.empty()) it->fulltype = p.fulltype;
+ if (it->default_value.empty()) it->default_value = p.default_value;
+ }
+ else
+ {
+ parameters.push_back(p);
+ }
+}
+
+
+
+
+/// Parses a "para" element
+/*
+This is used for different purposes within Doxygen.
+- Either a detailed description, possibly containing several sections (para's)
+ -> so parse next siblings
+- Or a detailed description also containing qbk records
+
+So we have to list explicitly either where to recurse, or where not to...
+
+*/
+static void parse_para(rapidxml::xml_node<>* node, std::string& contents, bool& skip, bool first = true)
+{
+ if (node != NULL)
+ {
+ if (node->type() == rapidxml::node_element)
+ {
+ //std::cout << "ELEMENT: " << node->name() << "=" << node->value() << std::endl;
+ std::string name = node->name();
+ if (boost::equals(name, "qbk.skip"))
+ {
+ skip = true;
+ return;
+ }
+ else if (! (
+ (boost::equals(name, "para") && first)
+ || boost::equals(name, "ref")
+ || boost::equals(name, "defval")
+ || boost::equals(name, "verbatim")
+ || boost::equals(name, "bold")
+ || boost::equals(name, "emphasis")
+ || boost::equals(name, "linebreak")
+ ))
+ {
+ return;
+ }
+ }
+ else if (node->type() == rapidxml::node_data)
+ {
+ contents += node->value();
+ //std::cout << "DATA: " << node->name() << "=" << node->value() << std::endl;
+ }
+ else
+ {
+ //std::cout << "OTHER: " << node->name() << "=" << node->value() << std::endl;
+ }
+ parse_para(node->first_node(), contents, skip, false);
+ parse_para(node->next_sibling(), contents, skip, false);
+ }
+}
+
+
+static void parse_parameter(rapidxml::xml_node<>* node, parameter& p)
+{
+ // #define: <param><defname>Point</defname></param>
+ // template: <param><type>typename</type><declname>CoordinateType</declname><defname>CoordinateType</defname></param>
+ // template with default: <param><type>typename</type><declname>CoordinateSystem</declname><defname>CoordinateSystem</defname><defval><ref ....>cs::cartesian</ref></defval></param>
+ // with enum: <type><ref refid="group__enum_1ga7d33eca9a5389952bdf719972eb802b6" kindref="member">closure_selector</ref></type>
+ if (node != NULL)
+ {
+ std::string name = node->name();
+ if (name == "type")
+ {
+ get_contents(node->first_node(), p.fulltype);
+ p.type = p.fulltype;
+ boost::replace_all(p.type, " const", "");
+ boost::trim(p.type);
+ boost::replace_all(p.type, "&", "");
+ boost::replace_all(p.type, "*", "");
+ boost::trim(p.type);
+ }
+ else if (name == "declname") p.name = node->value();
+ else if (name == "parametername") p.name = node->value();
+ else if (name == "defname") p.name = node->value();
+ else if (name == "defval")
+ {
+ parse_para(node, p.default_value, p.skip);
+ }
+ else if (name == "para")
+ {
+ parse_para(node, p.brief_description, p.skip);
+ }
+
+ parse_parameter(node->first_node(), p);
+ parse_parameter(node->next_sibling(), p);
+ }
+}
+
+static void parse_enumeration_value(rapidxml::xml_node<>* node, enumeration_value& value)
+{
+ // <enumvalue><name>green</name><initializer> 2</initializer>
+ // <briefdescription><para>...</para></briefdescription>
+ // <detaileddescription><para>...</para></detaileddescription>
+ // </enumvalue>
+ if (node != NULL)
+ {
+ std::string node_name = node->name();
+
+ if (node_name == "name") value.name = node->value();
+ else if (node_name == "para")
+ {
+ // Parses both brief AND detailed into this description
+ parse_para(node, value.brief_description, value.skip);
+ }
+ else if (node_name == "initializer")
+ {
+ value.initializer = node->value();
+ }
+
+ parse_enumeration_value(node->first_node(), value);
+ parse_enumeration_value(node->next_sibling(), value);
+ }
+}
+
+// Definition is a function or a class/struct
+template <typename Parameters>
+static void parse_parameter_list(rapidxml::xml_node<>* node, Parameters& parameters)
+{
+ if (node != NULL)
+ {
+ std::string name = node->name();
+
+ if (name == "parameteritem")
+ {
+ parameter p;
+ parse_parameter(node->first_node(), p);
+ if (! p.name.empty())
+ {
+ // Copy its description
+ std::vector<parameter>::iterator it = std::find_if(parameters.begin(),
+ parameters.end(), par_by_name(p.name));
+ if (it != parameters.end())
+ {
+ it->brief_description = p.brief_description;
+ }
+ else
+ {
+ parameters.push_back(p);
+ }
+ }
+ }
+ else if (name == "param")
+ {
+ // Element of 'templateparamlist.param (.type,.declname,.defname)'
+ parameter p;
+ parse_parameter(node->first_node(), p);
+
+ // Doxygen handles templateparamlist param's differently:
+ //
+ // Case 1:
+ // <param><type>typename T</type></param>
+ // -> no name, assign type to name, replace typename
+ //
+ // Case 2:
+ // <type>typename</type><declname>T</declname><defname>T</defname>
+ // -> set full type
+ if (p.name.empty())
+ {
+ // Case 1
+ p.name = p.type;
+ boost::replace_all(p.name, "typename", "");
+ boost::trim(p.name);
+ }
+ else
+ {
+ // Case 2
+ p.fulltype = p.type + " " + p.name;
+ }
+
+ add_or_set(parameters, p);
+ }
+
+ parse_parameter_list(node->first_node(), parameters);
+ parse_parameter_list(node->next_sibling(), parameters);
+ }
+}
+
+static void copy_string_property(std::string const& source, std::string& target)
+{
+ if (target.empty())
+ {
+ target = source;
+ }
+}
+
+
+template <typename Parameters>
+static void copy_parameter_properties(parameter const& source, Parameters& target)
+{
+ BOOST_FOREACH(parameter& t, target)
+ {
+ if (source.name == t.name)
+ {
+ t.skip = source.skip;
+ copy_string_property(source.brief_description, t.brief_description);
+ copy_string_property(source.type, t.type);
+ copy_string_property(source.default_value, t.default_value);
+ copy_string_property(source.fulltype, t.fulltype);
+
+ return;
+ }
+ }
+ // If not found, write a warning
+ std::cerr << "Parameter not found: " << source.name << std::endl;
+}
+
+
+template <typename Parameters>
+static void copy_parameters_properties(Parameters const& source, Parameters& target)
+{
+ BOOST_FOREACH(parameter const& s, source)
+ {
+ copy_parameter_properties(s, target);
+ }
+}
+
+
+
+template <typename Element>
+static void parse_element(rapidxml::xml_node<>* node, configuration const& config, std::string const& parent, Element& el)
+{
+ if (node != NULL)
+ {
+ std::string name = node->name();
+ std::string full = parent + "." + name;
+
+ if (full == ".briefdescription.para")
+ {
+ parse_para(node, el.brief_description, el.skip);
+ }
+ else if (full == ".detaileddescription.para")
+ {
+ std::string para;
+ parse_para(node, para, el.skip);
+ if (!para.empty() && !el.detailed_description.empty())
+ {
+ el.detailed_description += "\n\n";
+ }
+ el.detailed_description += para;
+ }
+ else if (full == ".location")
+ {
+ std::string loc = get_attribute(node, "file");
+ // Location of (header)file. It is a FULL path, so find the start
+ // and strip the rest
+ std::size_t pos = loc.rfind(config.start_include);
+ if (pos != std::string::npos)
+ {
+ loc = loc.substr(pos);
+ }
+ el.location = loc;
+ el.line = atol(get_attribute(node, "line").c_str());
+ }
+ else if (full == ".detaileddescription.para.qbk")
+ {
+ el.qbk_markup.push_back(markup(node->value()));
+ }
+ else if (full == ".detaileddescription.para.qbk.after.synopsis")
+ {
+ el.qbk_markup.push_back(markup(markup_after, markup_synopsis, node->value()));
+ }
+ else if (full == ".detaileddescription.para.qbk.before.synopsis")
+ {
+ el.qbk_markup.push_back(markup(markup_before, markup_synopsis, node->value()));
+ }
+ else if (full == ".detaileddescription.para.qbk.distinguish")
+ {
+ el.additional_description = node->value();
+ boost::trim(el.additional_description);
+ }
+ else if (full == ".templateparamlist")
+ {
+ parse_parameter_list(node->first_node(), el.template_parameters);
+ }
+ else if (full == ".detaileddescription.para.parameterlist")
+ {
+ std::string kind = get_attribute(node, "kind");
+ if (kind == "param")
+ {
+ // Parse parameters and their descriptions.
+ // NOTE: they are listed here, but the order might not be the order in the function call
+ std::vector<parameter> parameters;
+ parse_parameter_list(node->first_node(), parameters);
+ copy_parameters_properties(parameters, el.parameters);
+ }
+ else if (kind == "templateparam")
+ {
+ parse_parameter_list(node->first_node(), el.template_parameters);
+ }
+ }
+ else if (full == ".param")
+ {
+ // Parse one parameter, and add it to el.parameters
+ parameter p;
+ parse_parameter(node->first_node(), p);
+ el.parameters.push_back(p);
+ }
+
+
+ parse_element(node->first_node(), config, full, el);
+ parse_element(node->next_sibling(), config, parent, el);
+ }
+}
+
+static void parse_function(rapidxml::xml_node<>* node, configuration const& config, std::string const& parent, function& f)
+{
+ if (node != NULL)
+ {
+ std::string name = node->name();
+ std::string full = parent + "." + name;
+
+ if (full == ".name") f.name = node->value();
+ else if (full == ".argsstring") f.argsstring = node->value();
+ else if (full == ".definition")
+ {
+ f.definition = node->value();
+ if (! config.skip_namespace.empty())
+ {
+ boost::replace_all(f.definition, config.skip_namespace, "");
+ }
+ }
+ else if (full == ".param")
+ {
+ parameter p;
+ parse_parameter(node->first_node(), p);
+ add_or_set(f.parameters, p);
+ }
+ else if (full == ".type")
+ {
+ get_contents(node->first_node(), f.return_type);
+ }
+ else if (full == ".detaileddescription.para.simplesect")
+ {
+ std::string kind = get_attribute(node, "kind");
+ if (kind == "return")
+ {
+ get_contents(node->first_node(), f.return_description);
+ }
+ /*else if (kind == "param")
+ {
+ get_contents(node->first_node(), f.paragraphs);
+ }*/
+ }
+ else if (full == ".detaileddescription.para.image")
+ {
+ }
+
+ parse_function(node->first_node(), config, full, f);
+ parse_function(node->next_sibling(), config, parent, f);
+ }
+}
+
+static void parse_enumeration(rapidxml::xml_node<>* node, configuration const& config, std::string const& parent, enumeration& e)
+{
+ if (node != NULL)
+ {
+ std::string name = node->name();
+ std::string full = parent + "." + name;
+
+ if (full == ".name") e.name = node->value();
+ else if (full == ".enumvalue")
+ {
+ enumeration_value value;
+ parse_enumeration_value(node->first_node(), value);
+ e.enumeration_values.push_back(value);
+ }
+
+ parse_enumeration(node->first_node(), config, full, e);
+ parse_enumeration(node->next_sibling(), config, parent, e);
+ }
+}
+
+
+static std::string parse_named_node(rapidxml::xml_node<>* node, std::string const& look_for_name)
+{
+ if (node != NULL)
+ {
+ std::string node_name = node->name();
+ std::string contents;
+
+ if (boost::equals(node_name, look_for_name))
+ {
+ contents = node->value();
+ }
+
+ return contents
+ + parse_named_node(node->first_node(), look_for_name)
+ + parse_named_node(node->next_sibling(), look_for_name);
+ }
+ return "";
+}
+
+
+
+
+static void parse(rapidxml::xml_node<>* node, configuration const& config, documentation& doc, bool member = false)
+{
+ if (node != NULL)
+ {
+ bool recurse = false;
+ bool is_member = member;
+
+ std::string nodename = node->name();
+
+ if (nodename == "doxygen")
+ {
+ recurse = true;
+ }
+ else if (nodename == "sectiondef")
+ {
+ std::string kind = get_attribute(node, "kind");
+
+ if (kind == "func"
+ || kind == "define"
+ || kind == "enum"
+ )
+ {
+ recurse = true;
+ }
+ else if (boost::starts_with(kind, "public"))
+ {
+ recurse = true;
+ is_member = true;
+ }
+ }
+ else if (nodename == "compounddef")
+ {
+ std::string kind = get_attribute(node, "kind");
+ if (kind == "group")
+ {
+ recurse = true;
+ }
+ else if (kind == "struct")
+ {
+ recurse = true;
+ doc.cos.is_class = false;
+ parse_element(node->first_node(), config, "", doc.cos);
+ }
+ else if (kind == "class")
+ {
+ recurse = true;
+ doc.cos.is_class = true;
+ parse_element(node->first_node(), config, "", doc.cos);
+ }
+ }
+ else if (nodename == "memberdef")
+ {
+ std::string kind = get_attribute(node, "kind");
+ if (kind == "function")
+ {
+ function f;
+ parse_element(node->first_node(), config, "", f);
+ parse_function(node->first_node(), config, "", f);
+ if (member)
+ {
+ bool c_or_d = boost::equals(f.name, doc.cos.name) ||
+ boost::equals(f.name, std::string("~") + doc.cos.name);
+
+ f.type = c_or_d
+ ? function_constructor_destructor
+ : function_member;
+ doc.cos.functions.push_back(f);
+ }
+ else
+ {
+ f.type = function_free;
+ doc.functions.push_back(f);
+ }
+ }
+ else if (kind == "define")
+ {
+ function f;
+ f.type = function_define;
+ parse_element(node->first_node(), config, "", f);
+ parse_function(node->first_node(), config, "", f);
+ doc.functions.push_back(f);
+ }
+ else if (kind == "enum")
+ {
+ enumeration e;
+ parse_element(node->first_node(), config, "", e);
+ parse_enumeration(node->first_node(), config, "", e);
+ doc.enumerations.push_back(e);
+ }
+ else if (kind == "typedef")
+ {
+ if (boost::equals(get_attribute(node, "prot"), "public"))
+ {
+ std::string name = parse_named_node(node->first_node(), "name");
+ doc.cos.typedefs.push_back(base_element(name));
+ element dummy;
+ parse_element(node->first_node(), config, "", dummy);
+ doc.cos.typedefs.back().brief_description = dummy.brief_description;
+ }
+ }
+ else if (kind == "variable")
+ {
+ if (boost::equals(get_attribute(node, "static"), "yes")
+ && boost::equals(get_attribute(node, "mutable"), "no")
+ && boost::equals(get_attribute(node, "prot"), "public"))
+ {
+ std::string name = parse_named_node(node->first_node(), "name");
+ doc.cos.variables.push_back(base_element(name));
+ }
+ }
+
+ }
+ else if (nodename == "compoundname")
+ {
+ std::string name = node->value();
+ if (name.find("::") != std::string::npos)
+ {
+ doc.cos.fullname = name;
+
+ // For a class, it should have "boost::something::" before
+ // set its name without namespace
+ doc.cos.name = keep_after(name, "::");
+ }
+ }
+ else if (nodename == "basecompoundref")
+ {
+ base_class bc;
+ bc.name = node->value();
+ bc.derivation = get_attribute(node, "prot");
+ bc.virtuality = get_attribute(node, "virt");
+ doc.cos.base_classes.push_back(bc);
+ }
+ else
+ {
+ //std::cout << nodename << " ignored." << std::endl;
+ }
+
+
+ if (recurse)
+ {
+ // First recurse into childnodes, then handle next siblings
+ parse(node->first_node(), config, doc, is_member);
+ }
+ parse(node->next_sibling(), config, doc, is_member);
+ }
+}
+
+#endif // DOXYGEN_XML_PARSER_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/file_to_string.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/file_to_string.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,35 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef FILE_TO_STRING_HPP
+#define FILE_TO_STRING_HPP
+
+
+#include <string>
+#include <fstream>
+
+
+inline std::string file_to_string(std::string const& filename)
+{
+ std::string result;
+
+ std::ifstream cpp_file(filename.c_str());
+ if (cpp_file.is_open())
+ {
+ while (! cpp_file.eof() )
+ {
+ std::string line;
+ std::getline(cpp_file, line);
+ result += line + "\n";
+ }
+ }
+ return result;
+}
+
+
+#endif // FILE_TO_STRING_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/parameter_predicates.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/parameter_predicates.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,60 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef PARAMETER_PREDICATES_HPP
+#define PARAMETER_PREDICATES_HPP
+
+
+#include <string>
+
+#include <doxygen_elements.hpp>
+
+
+// Predicate for std::find_if
+struct par_by_name
+{
+ par_by_name(std::string const& n)
+ : m_name(n)
+ {}
+
+ inline bool operator()(parameter const& p)
+ {
+ return p.name == m_name;
+ }
+private :
+ std::string m_name;
+};
+
+
+// Predicate for std::find_if
+struct par_by_type
+{
+ par_by_type(std::string const& n)
+ : m_type(n)
+ {}
+
+ inline bool operator()(parameter const& p)
+ {
+ return p.type == m_type;
+ }
+private :
+ std::string m_type;
+};
+
+
+template <typename Element>
+struct sort_on_line
+{
+ inline bool operator()(Element const& left, Element const& right)
+ {
+ return left.line < right.line;
+ }
+};
+
+
+#endif // PARAMETER_PREDICATES_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/quickbook_output.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/quickbook_output.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,899 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef QUICKBOOK_OUTPUT_HPP
+#define QUICKBOOK_OUTPUT_HPP
+
+
+#include <string>
+#include <vector>
+
+#include <boost/algorithm/string.hpp>
+
+#include <doxygen_elements.hpp>
+#include <parameter_predicates.hpp>
+
+std::string qbk_escaped(std::string const& s)
+{
+ // Replace _ by unicode to avoid accidental quickbook underlining.
+ // 1) do NOT do this in quickbook markup, so not within []
+ // (e.g. to avoid [include get_point.qbk] having unicoded)
+ // 2) \[ and \] should not count as []
+ std::size_t const len = s.length();
+ int counter = 0;
+ std::string result = "";
+ for (std::size_t i = 0; i < len; i++)
+ {
+ switch(s[i])
+ {
+ case '[' : counter++; break;
+ case ']' : counter--; break;
+ case '\\' :
+ {
+ result += s[i];
+ if (i + 1 < len)
+ {
+ result += s[i + 1];
+ }
+ i++;
+ continue;
+ }
+ case '_' :
+ if (counter == 0)
+ {
+ result += "\\u005f";
+ continue;
+ }
+ }
+ result += s[i];
+ }
+
+ return result;
+}
+
+
+
+void quickbook_template_parameter_list(std::vector<parameter> const& parameters, std::ostream& out, bool multiline = false, bool show_defaults = false)
+{
+ std::string next_param;
+ if ( multiline )
+ {
+ if ( 2 < parameters.size() )
+ next_param = std::string(",\n") + " ";
+ else
+ next_param = ", ";
+ }
+ else
+ next_param = ", ";
+
+
+ if (!parameters.empty())
+ {
+ out << "template<" ;
+ bool first = true;
+ BOOST_FOREACH(parameter const& p, parameters)
+ {
+ out << (first ? "" : next_param.c_str()) << p.fulltype;
+
+ if ( show_defaults && !p.default_value.empty() )
+ out << " = " << p.default_value;
+
+ first = false;
+ }
+ out << ">" << std::endl;
+ }
+}
+
+
+void quickbook_synopsis(function const& f, std::ostream& out, bool multiline = false, bool show_defaults = false)
+{
+ out << "``";
+ quickbook_template_parameter_list(f.template_parameters, out, multiline, show_defaults);
+
+ unsigned offset = 1; // '('
+ switch(f.type)
+ {
+ case function_constructor_destructor :
+ out << f.name;
+ offset += f.name.size();
+ break;
+ case function_member :
+ out << f.return_type << " " << f.name;
+ offset += f.return_type.size() + 1 + f.name.size();
+ break;
+ case function_free :
+ out << f.definition;
+ offset += f.definition.size();
+ break;
+ case function_define :
+ out << "#define " << f.name;
+ offset += 8 + f.name.size();
+ break;
+ case function_unknown :
+ // do nothing
+ break;
+ }
+
+ std::string after_parameter(", ");
+ if ( multiline && 2 < f.parameters.size() )
+ after_parameter = std::string(",\n") + std::string(offset, ' ');
+
+ // Output the parameters
+ // Because we want to be able to skip, we cannot use the argstring
+ {
+ bool first = true;
+ BOOST_FOREACH(parameter const& p, f.parameters)
+ {
+ if (! p.skip)
+ {
+ out
+ << (first ? "(" : after_parameter)
+ << p.fulltype << (p.fulltype.empty() ? "" : " ")
+ << p.name
+ << (p.default_value.empty() ? "" : " = ")
+ << p.default_value;
+ first = false;
+ }
+ }
+ if (! first)
+ {
+ out << ")";
+ }
+ else if (f.type != function_define)
+ {
+ out << "()";
+ }
+ }
+
+ out << "``"
+ << std::endl
+ << std::endl;
+}
+
+
+void quickbook_synopsis(enumeration const& e, std::ostream& out)
+{
+ out << "``enum " << e.name;
+ bool first = true;
+ BOOST_FOREACH(enumeration_value const& value, e.enumeration_values)
+ {
+ out << (first ? " {" : ", ") << value.name;
+ if (! value.initializer.empty())
+ {
+ out << " = " << boost::trim_copy(value.initializer);
+ }
+ first = false;
+ }
+ if (! first)
+ {
+ out << "};";
+ }
+ out << "``"
+ << std::endl
+ << std::endl;
+}
+
+inline bool includes(std::string const& filename, std::string const& header)
+{
+ std::string result;
+
+ std::ifstream cpp_file(filename.c_str());
+ if (cpp_file.is_open())
+ {
+ while (! cpp_file.eof() )
+ {
+ std::string line;
+ std::getline(cpp_file, line);
+ boost::trim(line);
+ if (boost::starts_with(line, "#include")
+ && boost::contains(line, header))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
+void quickbook_header(std::string const& location,
+ configuration const& config,
+ std::ostream& out)
+{
+ if (! location.empty())
+ {
+ std::vector<std::string> including_headers;
+
+ // Select headerfiles containing to this location
+ BOOST_FOREACH(std::string const& header, config.convenience_headers)
+ {
+ if (includes(config.convenience_header_path + header, location))
+ {
+ including_headers.push_back(header);
+ }
+ }
+
+ out << "[heading Header]" << std::endl;
+ if (! including_headers.empty())
+ {
+ out << "Either"
+ << (including_headers.size() > 1 ? " one of" : "")
+ << std::endl << std::endl;
+ BOOST_FOREACH(std::string const& header, including_headers)
+ {
+ out << "`#include <" << config.start_include << header << ">`" << std::endl;
+ }
+
+ out << std::endl << "Or" << std::endl << std::endl;
+ }
+ out << "`#include <" << location << ">`" << std::endl;
+ out << std::endl;
+ }
+}
+
+
+void quickbook_markup(std::vector<markup> const& qbk_markup,
+ markup_order_type order, markup_type type,
+ std::ostream& out)
+{
+ bool has_output = false;
+ BOOST_FOREACH(markup const& inc, qbk_markup)
+ {
+ if (inc.type == type && inc.order == order)
+ {
+ out << inc.value << std::endl;
+ has_output = true;
+ }
+ }
+ if (has_output)
+ {
+ out << std::endl;
+ }
+}
+
+
+
+void quickbook_string_with_heading_if_present(std::string const& heading,
+ std::string const& contents, std::ostream& out)
+{
+ if (! contents.empty())
+ {
+ out << "[heading " << heading << "]" << std::endl
+ << qbk_escaped(contents) << std::endl
+ << std::endl;
+ }
+}
+
+inline std::string to_section_name(std::string const& name)
+{
+ // Make section-name lowercase and remove :: because these are filenames
+ return boost::to_lower_copy(boost::replace_all_copy(name, "::", "_"));
+}
+
+
+
+void quickbook_short_output(function const& f, std::ostream& out)
+{
+ BOOST_FOREACH(parameter const& p, f.parameters)
+ {
+ if (! p.skip)
+ {
+ out << "[* " << p.fulltype << "]: ['" << p.name << "]: " << p.brief_description << std::endl << std::endl;
+ }
+ }
+ out << std::endl;
+ out << std::endl;
+
+ if (! f.return_description.empty())
+ {
+ out << "][" << std::endl;
+ out << f.return_description << std::endl;
+ out << std::endl;
+ }
+
+ out << std::endl;
+}
+
+inline std::string namespace_skipped(std::string const& name, configuration const& config)
+{
+ return config.skip_namespace.empty()
+ ? name
+ : boost::replace_all_copy(name, config.skip_namespace, "")
+ ;
+}
+
+inline std::string output_if_different(std::string const& s, std::string const& s2)
+{
+ return boost::equals(s, s2)
+ ? ""
+ : s + " "
+ ;
+}
+
+inline void quickbook_output_indexterm(std::string const& term, std::ostream& out
+ //, std::string const& secondary = ""
+ )
+{
+ out << "'''";
+ if (boost::contains(term, "::"))
+ {
+ // "Unnamespace" it and add all terms (also namespaces)
+ std::vector<std::string> splitted;
+ std::string for_split = boost::replace_all_copy(term, "::", ":");
+ boost::split(splitted, for_split, boost::is_any_of(":"), boost::token_compress_on);
+ BOOST_FOREACH(std::string const& part, splitted)
+ {
+ out << "<indexterm><primary>" << part << "</primary></indexterm>";
+ }
+ }
+ else
+ {
+ out << "<indexterm><primary>" << term;
+ /*if (! secondary.empty())
+ {
+ out << "<secondary>" << secondary << "</secondary>";
+ }*/
+ out << "</primary></indexterm>";
+ }
+ out << "'''" << std::endl;
+}
+
+template <typename Tag>
+void quickbook_output(function const& f, configuration const& config, std::ostream& out, Tag const&)
+{
+ // Write the parsed function
+ int arity = (int)f.parameters.size();
+
+ std::string additional_description;
+
+ if (! f.additional_description.empty())
+ {
+ additional_description = " (";
+ additional_description += f.additional_description;
+ additional_description += ")";
+ }
+
+ out << "[section:" << to_section_name(f.name);
+ // Make section name unique if necessary by arity and additional description
+ if (! f.unique)
+ {
+ out << "_" << arity;
+ if (! f.additional_description.empty())
+ {
+ out << "_" << boost::to_lower_copy(boost::replace_all_copy(f.additional_description, " ", "_"));
+ }
+ }
+ out << " " << f.name
+ << additional_description
+ << "]" << std::endl
+ << std::endl;
+
+ quickbook_output_indexterm(f.name, out);
+
+ out << qbk_escaped(f.brief_description) << std::endl;
+ out << std::endl;
+
+ quickbook_string_with_heading_if_present("Description", f.detailed_description, out);
+
+ // Synopsis
+ quickbook_markup(f.qbk_markup, markup_before, markup_synopsis, out);
+ out << "[heading Synopsis]" << std::endl;
+ quickbook_synopsis(f, out);
+ quickbook_markup(f.qbk_markup, markup_after, markup_synopsis, out);
+
+
+ out << "[heading Parameters]" << std::endl
+ << std::endl;
+
+ out << "[table" << std::endl << "[";
+ if (f.type != function_define)
+ {
+ out << "[Type] [Concept] ";
+ }
+ out << "[Name] [Description] ]" << std::endl;
+
+ // First: output any template parameter which is NOT used in the normal parameter list
+ BOOST_FOREACH(parameter const& tp, f.template_parameters)
+ {
+ if (! tp.skip)
+ {
+ std::vector<parameter>::const_iterator it = std::find_if(f.parameters.begin(), f.parameters.end(), par_by_type(tp.name));
+
+ if (it == f.parameters.end())
+ {
+ out << "[[" << tp.name << "] [" << tp.brief_description << "] [ - ] [Must be specified]]" << std::endl;
+ }
+ }
+ }
+
+ BOOST_FOREACH(parameter const& p, f.parameters)
+ {
+ if (! p.skip)
+ {
+ out << "[";
+ std::vector<parameter>::const_iterator it = std::find_if(f.template_parameters.begin(),
+ f.template_parameters.end(), par_by_name(p.type));
+
+ if (f.type != function_define)
+ {
+ out << "[" << p.fulltype
+ << "] [" << (it == f.template_parameters.end() ? "" : it->brief_description)
+ << "] ";
+ }
+ out << "[" << p.name
+ << "] [" << p.brief_description
+ << "]]"
+ << std::endl;
+ }
+ }
+ out << "]" << std::endl
+ << std::endl
+ << std::endl;
+
+ quickbook_string_with_heading_if_present("Returns", f.return_description, out);
+
+ quickbook_header(f.location, config, out);
+ quickbook_markup(f.qbk_markup, markup_any, markup_default, out);
+
+ out << std::endl;
+ out << "[endsect]" << std::endl;
+ out << std::endl;
+}
+
+template <typename Tag>
+void quickbook_output(enumeration const& e, configuration const& config, std::ostream& out, Tag const&)
+{
+ out << "[section:" << to_section_name(e.name);
+ out << " " << e.name
+ << "]" << std::endl
+ << std::endl;
+
+ quickbook_output_indexterm(e.name, out);
+ BOOST_FOREACH(enumeration_value const& value, e.enumeration_values)
+ {
+ quickbook_output_indexterm(value.name, out);
+ }
+
+ out << e.brief_description << std::endl;
+ out << std::endl;
+
+ quickbook_string_with_heading_if_present("Description", e.detailed_description, out);
+
+ // Synopsis
+ quickbook_markup(e.qbk_markup, markup_before, markup_synopsis, out);
+ out << "[heading Synopsis]" << std::endl;
+ quickbook_synopsis(e, out);
+ quickbook_markup(e.qbk_markup, markup_after, markup_synopsis, out);
+
+
+ out << "[heading Values]" << std::endl
+ << std::endl;
+
+ out << "[table" << std::endl << "[";
+ out << "[Value] [Description] ]" << std::endl;
+
+ BOOST_FOREACH(enumeration_value const& value, e.enumeration_values)
+ {
+ out << "[[" << value.name
+ << "] [" << value.brief_description
+ << "]]"
+ << std::endl;
+ }
+ out << "]" << std::endl
+ << std::endl
+ << std::endl;
+
+ quickbook_header(e.location, config, out);
+ quickbook_markup(e.qbk_markup, markup_any, markup_default, out);
+
+ out << std::endl;
+ out << "[endsect]" << std::endl;
+ out << std::endl;
+}
+
+void quickbook_output_member(std::vector<function> const& functions,
+ function_type type,
+ std::string const& title,
+ configuration const& config, std::ostream& out)
+{
+ std::string returns = type == function_constructor_destructor ? "" : " [Returns]";
+ out << "[heading " << title << "(s)]" << std::endl
+ << "[table" << std::endl
+ << "[[Function] [Description] [Parameters] " << returns << "]" << std::endl;
+
+ BOOST_FOREACH(function const& f, functions)
+ {
+ if (f.type == type)
+ {
+ out << "[[";
+ quickbook_synopsis(f, out);
+ out << "] [" << f.brief_description << "] [";
+ quickbook_short_output(f, out);
+ out << "]]" << std::endl;
+ }
+ }
+ out << "]" << std::endl
+ << std::endl;
+}
+
+template <typename Tag>
+void quickbook_output(class_or_struct const& cos, configuration const& config, std::ostream& out, Tag const&)
+{
+ // Skip namespace
+ std::string short_name = namespace_skipped(cos.fullname, config);
+
+ // Write the parsed function
+ out << "[section:" << to_section_name(short_name) << " " << short_name << "]" << std::endl
+ << std::endl;
+
+ quickbook_output_indexterm(short_name, out);
+
+ out << cos.brief_description << std::endl;
+ out << std::endl;
+
+ quickbook_string_with_heading_if_present("Description", cos.detailed_description, out);
+
+ quickbook_markup(cos.qbk_markup, markup_before, markup_synopsis, out);
+ out << "[heading Synopsis]" << std::endl
+ << "``";
+ quickbook_template_parameter_list(cos.template_parameters, out, false);
+ out << (cos.is_class ? "class" : "struct")
+ << " " << short_name << std::endl;
+
+ if (! cos.base_classes.empty())
+ {
+ out << " : ";
+ bool first = true;
+ BOOST_FOREACH(base_class const& bc, cos.base_classes)
+ {
+ if (! first)
+ {
+ out << std::endl << " , ";
+ }
+ out << output_if_different(bc.derivation, "private")
+ << output_if_different(bc.virtuality, "non-virtual")
+ << namespace_skipped(bc.name, config);
+ first = false;
+ }
+ out << std::endl;
+ }
+
+ out << "{" << std::endl
+ << " // ..." << std::endl
+ << "};" << std::endl
+ << "``" << std::endl << std::endl;
+ quickbook_markup(cos.qbk_markup, markup_after, markup_synopsis, out);
+
+
+
+ if (! cos.template_parameters.empty())
+ {
+ bool has_default = false;
+ BOOST_FOREACH(parameter const& p, cos.template_parameters)
+ {
+ if (! p.default_value.empty())
+ {
+ has_default = true;
+ }
+ }
+
+ out << "[heading Template parameter(s)]" << std::endl
+ << "[table" << std::endl
+ << "[[Parameter]";
+ if (has_default)
+ {
+ out << " [Default]";
+ }
+ out << " [Description]]" << std::endl;
+
+ BOOST_FOREACH(parameter const& p, cos.template_parameters)
+ {
+ out << "[[``";
+ if ( p.fulltype.find("typename") == 0 )
+ out << p.fulltype.substr(8);
+ else if ( p.fulltype.find("class") == 0 )
+ out << p.fulltype.substr(5);
+ else
+ out << p.fulltype;
+
+ out << "``]";
+
+ if (has_default && !p.default_value.empty())
+ out << "[``" << p.default_value << "``]";
+ else
+ out << "[]";
+
+ out << " [" << p.brief_description << "]]" << std::endl;
+ }
+ out << "]" << std::endl
+ << std::endl;
+ }
+
+
+ std::map<function_type, int> counts;
+ BOOST_FOREACH(function const& f, cos.functions)
+ {
+ counts[f.type]++;
+ }
+
+ if (counts[function_constructor] > 0)
+ {
+ quickbook_output_member(cos.functions, function_constructor, "Constructor", config, out);
+ }
+
+ if (counts[function_member] > 0)
+ {
+ quickbook_output_member(cos.functions, function_member, "Member Function", config, out);
+ }
+
+ quickbook_header(cos.location, config, out);
+ quickbook_markup(cos.qbk_markup, markup_any, markup_default, out);
+
+ out << "[endsect]" << std::endl
+ << std::endl;
+}
+
+
+
+
+
+
+void quickbook_synopsis_short(function const& f, std::ostream& out)
+{
+ switch(f.type)
+ {
+ case function_constructor_destructor :
+ out << f.name;
+ break;
+ case function_member :
+ out << f.name;
+ break;
+ case function_free :
+ out << f.name;
+ break;
+ case function_define :
+ out << "#define " << f.name;
+ break;
+ case function_unknown :
+ // do nothing
+ break;
+ }
+
+ // Output the parameters
+ // Because we want to be able to skip, we cannot use the argstring
+ {
+ bool first = true;
+ BOOST_FOREACH(parameter const& p, f.parameters)
+ {
+ if ( !p.skip && p.default_value.empty() )
+ {
+ out << (first ? "(" : ", ") << p.fulltype;
+ first = false;
+ }
+ }
+
+ if (! first)
+ out << ")";
+ else if (f.type != function_define)
+ out << "()";
+ }
+}
+
+void quickbook_output_member(class_or_struct const& cos,
+ std::vector<function> const& functions,
+ function_type type,
+ configuration const& config, std::ostream& out)
+{
+ out << "[table" << std::endl
+ << "[[Function][Description]]" << std::endl;
+
+ for ( size_t i = 0 ; i < functions.size() ; ++i )
+ {
+ function const& f = functions[i];
+
+ if (f.type == type)
+ {
+ out << "[[`";
+ quickbook_synopsis_short(f, out);
+ out << "`][" << f.brief_description << "]]" << std::endl;
+ }
+ }
+ out << "]" << std::endl
+ << std::endl;
+}
+
+void quickbook_output_detail_member(class_or_struct const& cos,
+ std::vector<function> const& functions,
+ function_type type,
+ configuration const& config, std::ostream& out)
+{
+ for ( size_t i = 0 ; i < functions.size() ; ++i )
+ {
+ function const& f = functions[i];
+ if (f.type == type)
+ {
+ std::stringstream ss;
+ quickbook_synopsis_short(f, ss);
+
+ out << "[section " << ss.str() << "]" << std::endl;
+
+ out << "[heading Synopsis]" << std::endl;
+ quickbook_synopsis(f, out, true, true);
+
+ if ( !f.detailed_description.empty() || !f.brief_description.empty() )
+ {
+ out << "[heading Description]" << std::endl;
+ if ( !f.detailed_description.empty() )
+ out << f.detailed_description;
+ else
+ out << f.brief_description;
+ }
+
+ if ( !f.parameters.empty() )
+ {
+ out << "[heading Parameters]" << std::endl;
+ out << "[table " << std::endl;
+ out << "[[Type][Name][Description]]" << std::endl;
+ BOOST_FOREACH(parameter const& p, f.parameters)
+ {
+ if (!p.skip)
+ {
+ out << "[[*" << p.fulltype << "*]['" << p.name << "'][" << p.brief_description << "]]"<< std::endl;
+ }
+ }
+ out << "]" << std::endl;
+ }
+
+ if ( !f.return_description.empty() )
+ {
+ out << "[heading Returns]" << std::endl;
+ out << f.return_description << std::endl;
+ }
+
+ out << "[endsect]" << std::endl
+ << std::endl;
+ }
+ }
+}
+
+struct quickbook_output_cos_alt {};
+
+void quickbook_output(class_or_struct const& cos, configuration const& config, std::ostream& out, quickbook_output_cos_alt const&)
+{
+ // Skip namespace
+ std::string short_name = namespace_skipped(cos.fullname, config);
+
+ // Write the parsed function
+ out << "[section:" << to_section_name(short_name) << " " << short_name << "]" << std::endl
+ << std::endl;
+
+ quickbook_output_indexterm(short_name, out);
+
+ // Brief
+
+ out << cos.brief_description << std::endl;
+ out << std::endl;
+
+ // Description
+
+ quickbook_string_with_heading_if_present("Description", cos.detailed_description, out);
+
+ // Header
+
+ quickbook_header(cos.location, config, out);
+
+ // Class synposis
+
+ quickbook_markup(cos.qbk_markup, markup_before, markup_synopsis, out);
+ out << "[heading Synopsis]" << std::endl
+ << "``";
+ quickbook_template_parameter_list(cos.template_parameters, out, true, true);
+ out << (cos.is_class ? "class " : "struct ");
+ out << short_name.substr(short_name.find_last_of("::") + 1) << std::endl;
+
+ if (! cos.base_classes.empty())
+ {
+ out << " : ";
+ bool first = true;
+ BOOST_FOREACH(base_class const& bc, cos.base_classes)
+ {
+ if (! first)
+ {
+ out << std::endl << " , ";
+ }
+ out << output_if_different(bc.derivation, "private")
+ << output_if_different(bc.virtuality, "non-virtual")
+ << namespace_skipped(bc.name, config);
+ first = false;
+ }
+ out << std::endl;
+ }
+
+ out << "{" << std::endl
+ << " // ..." << std::endl
+ << "};" << std::endl
+ << "``" << std::endl << std::endl;
+ quickbook_markup(cos.qbk_markup, markup_after, markup_synopsis, out);
+
+ // Template parameters
+
+ if (! cos.template_parameters.empty())
+ {
+ out << "[heading Template parameter(s)]" << std::endl
+ << "[table" << std::endl
+ << "[[Parameter] [Description]]" << std::endl;
+
+ BOOST_FOREACH(parameter const& p, cos.template_parameters)
+ {
+ out << "[[`";
+ if ( p.fulltype.find("typename ") == 0 )
+ out << p.fulltype.substr(9);
+ else if ( p.fulltype.find("class ") == 0 )
+ out << p.fulltype.substr(6);
+ else
+ out << p.fulltype;
+ out << "`][" << p.brief_description << "]]" << std::endl;
+ }
+ out << "]" << std::endl
+ << std::endl;
+ }
+
+ // Typedefs
+
+ if ( !cos.typedefs.empty() )
+ {
+ out << "[heading Typedef(s)]" << std::endl
+ << "[table" << std::endl
+ << "[[Type]";
+ out << " [Description]]" << std::endl;
+
+ BOOST_FOREACH(base_element const& e, cos.typedefs)
+ {
+ out << "[[`" << e.name;
+ out << "`][" << e.brief_description << "]]" << std::endl;
+ }
+ out << "]" << std::endl
+ << std::endl;
+ }
+
+ // Members
+
+ std::map<function_type, int> counts;
+ BOOST_FOREACH(function const& f, cos.functions)
+ {
+ counts[f.type]++;
+ }
+
+ if (counts[function_constructor_destructor] > 0)
+ {
+ out << "[heading Constructor(s) and destructor]" << std::endl;
+ quickbook_output_member(cos, cos.functions, function_constructor_destructor, config, out);
+ }
+
+ if (counts[function_member] > 0)
+ {
+ out << "[heading Member(s)]" << std::endl;
+ quickbook_output_member(cos, cos.functions, function_member, config, out);
+ }
+
+ quickbook_markup(cos.qbk_markup, markup_any, markup_default, out);
+
+ // Details start
+
+ if (counts[function_constructor_destructor] > 0)
+ quickbook_output_detail_member(cos, cos.functions, function_constructor_destructor, config, out);
+ if (counts[function_member] > 0)
+ quickbook_output_detail_member(cos, cos.functions, function_member, config, out);
+
+ // Details end
+
+ out << "[endsect]" << std::endl
+ << std::endl;
+}
+
+#endif // QUICKBOOK_OUTPUT_HPP

Added: sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/rapidxml_util.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/tools/doxygen_xml2qbk/rapidxml_util.hpp 2013-01-07 18:15:57 EST (Mon, 07 Jan 2013)
@@ -0,0 +1,68 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+#ifndef RAPIDXML_UTIL_HPP
+#define RAPIDXML_UTIL_HPP
+
+
+#include <string>
+#include <rapidxml.hpp>
+
+class xml_doc : public rapidxml::xml_document<>
+{
+ public :
+ xml_doc(const char* xml)
+ {
+ // Make a copy because rapidxml destructs string
+ m_copy = new char[strlen(xml) + 1];
+ strcpy(m_copy, xml);
+ this->parse<0>(m_copy);
+ };
+ virtual ~xml_doc()
+ {
+ delete[] m_copy;
+ }
+ private :
+ char* m_copy;
+
+};
+
+inline std::string get_attribute(rapidxml::xml_node<>* node, const char* name)
+{
+ rapidxml::xml_attribute<> *attr = node->first_attribute(name);
+ std::string value;
+ if (attr)
+ {
+ value = attr->value();
+ }
+ return value;
+}
+
+inline void get_contents(rapidxml::xml_node<>* node, std::string& contents)
+{
+ if (node != NULL)
+ {
+ if (node->type() == rapidxml::node_element)
+ {
+ //std::cout << "ELEMENT: " << node->name() << "=" << node->value() << std::endl;
+ }
+ else if (node->type() == rapidxml::node_data)
+ {
+ contents += node->value();
+ //std::cout << "DATA: " << node->name() << "=" << node->value() << std::endl;
+ }
+ else
+ {
+ //std::cout << "OTHER: " << node->name() << "=" << node->value() << std::endl;
+ }
+ get_contents(node->first_node(), contents);
+ get_contents(node->next_sibling(), contents);
+ }
+}
+
+#endif // RAPIDXML_UTIL_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk