|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85384 - in trunk/libs/geometry/doc: . src/docutils/tools/doxygen_xml2qbk
From: barend.gehrels_at_[hidden]
Date: 2013-08-17 17:05:44
Author: barendgehrels
Date: 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013)
New Revision: 85384
URL: http://svn.boost.org/trac/boost/changeset/85384
Log:
[geometry][doxygen_xml2qbk][#8825] applied patch (modified making behaviour optional)
Text files modified:
trunk/libs/geometry/doc/make_qbk.py | 1
trunk/libs/geometry/doc/release_notes.qbk | 1
trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp | 7 +++++
trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp | 2
trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp | 4 ++
trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp | 43 ++++++++++++++++++++++++++++++++++-----
trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp | 35 +++++++++++++++++++++++++++++--
7 files changed, 81 insertions(+), 12 deletions(-)
Modified: trunk/libs/geometry/doc/make_qbk.py
==============================================================================
--- trunk/libs/geometry/doc/make_qbk.py Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/make_qbk.py 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -31,6 +31,7 @@
cmd = cmd + " --convenience_headers geometry.hpp,geometries/geometries.hpp,multi/multi.hpp"
cmd = cmd + " --skip_namespace boost::geometry::"
cmd = cmd + " --copyright src/copyright_block.qbk"
+cmd = cmd + " --output_member_variables false"
cmd = cmd + " > generated/%s.qbk"
def call_doxygen():
Modified: trunk/libs/geometry/doc/release_notes.qbk
==============================================================================
--- trunk/libs/geometry/doc/release_notes.qbk Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/release_notes.qbk 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -28,6 +28,7 @@
[*Solved tickets]
* [@https://svn.boost.org/trac/boost/ticket/8969 8969] boost::geometry::model::point single argument constructor should be explicit
+* [@https://svn.boost.org/trac/boost/ticket/8825 8825] Patch adding member variable documentation to doxygen_xml2qbk
[*Internal changes]
Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -29,10 +29,15 @@
std::vector<std::string> convenience_headers;
std::string skip_namespace;
+ bool output_member_variables;
enum output_style_type {def, alt};
output_style_type output_style;
- configuration() : output_style(def) {}
+
+ configuration()
+ : output_style(def)
+ , output_member_variables(false)
+ {}
};
Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -164,7 +164,7 @@
std::vector<function> functions;
std::vector<base_element> typedefs;
- std::vector<base_element> variables;
+ std::vector<parameter> variables;
std::vector<base_class> base_classes;
};
Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -42,7 +42,7 @@
#include <quickbook_output.hpp>
#include <rapidxml_util.hpp>
-static const std::string version = "1.1.0";
+static const std::string version = "1.1.1";
inline std::string program_description(bool decorated)
{
@@ -95,6 +95,8 @@
("output_style", po::value<std::string>(&output_style),
"Docbook output style. Available values: 'alt'")
+ ("output_member_variables", po::value<bool>(&config.output_member_variables),
+ "Output member variables inside the class")
;
po::variables_map varmap;
Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -691,13 +691,44 @@
}
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"))
+ if (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));
- doc.cos.variables.back().id = id;
+ parameter p;
+ p.id = id;
+ for(rapidxml::xml_node<>* var_node = node->first_node(); var_node; var_node=var_node->next_sibling())
+ {
+ if(boost::equals(var_node->name(), "name"))
+ {
+ p.name = var_node->value();
+ }
+ else if(boost::equals(var_node->name(), "type"))
+ {
+ get_contents(var_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);
+
+ // If alt output is used retrieve type with QBK links
+ if ( configuration::alt == config.output_style )
+ {
+ p.fulltype_without_links = p.fulltype;
+ p.fulltype.clear();
+ parse_para(var_node->first_node(), config, p.fulltype, p.skip);
+ }
+ }
+ else if(boost::equals(var_node->name(), "briefdescription"))
+ {
+ parse_para(var_node->first_node(), config, p.brief_description, p.skip);
+ }
+ else if(p.brief_description.empty() && boost::equals(var_node->name(), "detaileddescription"))
+ {
+ parse_para(var_node->first_node(), config, p.brief_description, p.skip);
+ }
+ }
+ doc.cos.variables.push_back(p);
}
}
Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp Sat Aug 17 16:04:23 2013 (r85383)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp 2013-08-17 17:05:44 EDT (Sat, 17 Aug 2013) (r85384)
@@ -544,9 +544,38 @@
out << std::endl;
}
- out << "{" << std::endl
- << " // ..." << std::endl
- << "};" << std::endl
+ out << "{" << std::endl;
+ if (! cos.variables.empty() && config.output_member_variables)
+ {
+ size_t maxlength = 0;
+ BOOST_FOREACH(parameter const& p, cos.variables)
+ {
+ if (! p.skip)
+ {
+ size_t length = 6 + p.fulltype.size() + p.name.size();
+ if (length > maxlength) maxlength = length;
+ }
+ }
+ BOOST_FOREACH(parameter const& p, cos.variables)
+ {
+ if (! p.skip)
+ {
+ size_t length = 4 + p.fulltype.size() + p.name.size();
+ out << " " << p.fulltype << " " << p.name << ";";
+ if (! p.brief_description.empty())
+ {
+ while(length++ < maxlength) out << " ";
+ out << "// " << p.brief_description;
+ }
+ out << std::endl;
+ }
+ }
+ }
+ else
+ {
+ out << " // ..." << std::endl;
+ }
+ out << "};" << std::endl
<< "``" << std::endl << std::endl;
quickbook_markup(cos.qbk_markup, markup_after, markup_synopsis, out);
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