[geometry] Remove all trailing spaces (tools)

This commit is contained in:
Barend Gehrels 2013-12-05 19:40:50 +01:00
parent ed4e7bb921
commit d60df91ca0
7 changed files with 76 additions and 76 deletions

View File

@ -34,9 +34,9 @@ struct configuration
enum output_style_type {def, alt};
output_style_type output_style;
configuration()
: output_style(def)
, output_member_variables(false)
configuration()
: output_style(def)
, output_member_variables(false)
{}
};

View File

@ -19,12 +19,12 @@ 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,
enum function_type
{
function_unknown,
function_define,
function_constructor_destructor,
function_member,
function_free,
};
@ -32,7 +32,7 @@ struct base_element
{
std::string name;
std::string brief_description;
bool skip;
std::string id;
@ -153,7 +153,7 @@ struct enumeration : public element
struct base_class
{
std::string name;
std::string derivation; // "prot" element
std::string derivation; // "prot" element
std::string virtuality; // "virt" element
};
@ -176,10 +176,10 @@ struct documentation
std::string group_title;
// Only one expected (no grouping)
class_or_struct cos;
class_or_struct cos;
// There can be many of them (in groups):
std::vector<function> functions;
std::vector<function> functions;
std::vector<function> defines;
std::vector<enumeration> enumerations;
};

View File

@ -80,22 +80,22 @@ int main(int argc, char** argv)
description.add_options()
("help", "Help message")
("version", "Version description")
("xml", po::value<std::string>(&filename),
("xml", po::value<std::string>(&filename),
"Name of XML file written by Doxygen")
("start_include", po::value<std::string>(&config.start_include),
("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", po::value<std::string>(&config.convenience_header_path),
"Convenience header path")
("convenience_headers", po::value<std::string>(&convenience_headers),
("convenience_headers", po::value<std::string>(&convenience_headers),
"Convenience header(s) (comma-separated)")
("skip_namespace", po::value<std::string>(&config.skip_namespace),
("skip_namespace", po::value<std::string>(&config.skip_namespace),
"Namespace to skip (e.g. boost::mylib::)")
("copyright", po::value<std::string>(&copyright_filename),
("copyright", po::value<std::string>(&copyright_filename),
"Name of QBK file including (commented) copyright and license")
("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", po::value<bool>(&config.output_member_variables),
"Output member variables inside the class")
;
@ -121,16 +121,16 @@ int main(int argc, char** argv)
}
else if (varmap.count("help"))
{
std::cout
<< program_description(true) << std::endl
std::cout
<< program_description(true) << std::endl
<< "Available options:" << std::endl
<< description << std::endl;
return 0;
}
else if (filename.empty())
{
std::cout
<< program_description(true) << std::endl
std::cout
<< program_description(true) << std::endl
<< "Allowed options:" << std::endl
<< description << std::endl;
return 1;
@ -149,8 +149,8 @@ int main(int argc, char** argv)
// Read files into strings
std::string xml_string = file_to_string(filename);
std::string license = copyright_filename.empty()
? ""
std::string license = copyright_filename.empty()
? ""
: file_to_string(copyright_filename);
// Parse the XML outputted by Doxygen
@ -236,7 +236,7 @@ int main(int argc, char** argv)
}
catch(...)
{
std::cerr << "Unknown exception in doxygen_xml2qbk"
std::cerr << "Unknown exception in doxygen_xml2qbk"
<< std::endl;
return 1;
}

View File

@ -53,9 +53,9 @@ static inline void add_or_set(std::vector<parameter>& parameters, parameter cons
/// Parses a "para" element
/// Parses a "para" element
/*
This is used for different purposes within Doxygen.
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
@ -138,11 +138,11 @@ static void parse_para(rapidxml::xml_node<>* node, configuration const& config,
{
contents += std::string("[link ") + refid + " ";
parse_para(node->first_node(), config, contents, skip, false, in_block);
contents += "]";
contents += "]";
parse_para(node->next_sibling(), config, contents, skip, false, tb);
return;
}
}
}
}
else if (! (
(boost::equals(name, "para") && first)
@ -210,8 +210,8 @@ static void parse_parameter(rapidxml::xml_node<>* node, configuration const& con
}
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")
else if (name == "defname") p.name = node->value();
else if (name == "defval")
{
parse_para(node, config, p.default_value, p.skip);
}
@ -439,7 +439,7 @@ static void parse_element(rapidxml::xml_node<>* node, configuration const& confi
p.title = title_node->value();
parse_para(node->first_node("para"), config, p.text, el.skip);
el.paragraphs.push_back(p);
}
else if (kind == "warning")
@ -649,7 +649,7 @@ static void parse(rapidxml::xml_node<>* node, configuration const& config, docum
boost::equals(f.name, std::string("~") + doc.cos.name);
f.type = c_or_d
? function_constructor_destructor
? function_constructor_destructor
: function_member;
doc.cos.functions.push_back(f);
}

View File

@ -34,7 +34,7 @@ std::string qbk_escaped(std::string const& s)
{
case '[' : counter++; break;
case ']' : counter--; break;
case '\\' :
case '\\' :
{
result += s[i];
if (i + 1 < len)
@ -44,7 +44,7 @@ std::string qbk_escaped(std::string const& s)
i++;
continue;
}
case '_' :
case '_' :
if (counter == 0)
{
result += "\\u005f";
@ -104,7 +104,7 @@ void quickbook_synopsis(function const& f, std::ostream& out)
// do nothing
break;
}
// Output the parameters
// Because we want to be able to skip, we cannot use the argstring
{
@ -113,7 +113,7 @@ void quickbook_synopsis(function const& f, std::ostream& out)
{
if (! p.skip)
{
out
out
<< (first ? "(" : ", ")
<< p.fulltype << (p.fulltype.empty() ? "" : " ")
<< p.name
@ -132,7 +132,7 @@ void quickbook_synopsis(function const& f, std::ostream& out)
}
}
out << "``"
out << "``"
<< std::endl
<< std::endl;
}
@ -157,7 +157,7 @@ void quickbook_synopsis(enumeration const& e, std::ostream& out)
{
out << "};";
}
out << "``"
out << "``"
<< std::endl
<< std::endl;
}
@ -221,8 +221,8 @@ void quickbook_header(std::string const& location,
}
void quickbook_markup(std::vector<markup> const& qbk_markup,
markup_order_type order, markup_type type,
void quickbook_markup(std::vector<markup> const& qbk_markup,
markup_order_type order, markup_type type,
std::ostream& out)
{
bool has_output = false;
@ -357,7 +357,7 @@ void quickbook_output(function const& f, configuration const& config, std::ostre
<< std::endl;
quickbook_output_indexterm(f.name, out);
out << qbk_escaped(f.brief_description) << std::endl;
out << std::endl;
@ -478,7 +478,7 @@ void quickbook_output(enumeration const& e, configuration const& config, std::os
out << std::endl;
}
void quickbook_output_function(std::vector<function> const& functions,
void quickbook_output_function(std::vector<function> const& functions,
function_type type,
std::string const& title,
configuration const& config, std::ostream& out)
@ -734,7 +734,7 @@ void quickbook_output_functions(std::vector<function> const& functions,
BOOST_FOREACH(function const& f, functions)
{
if ( (display_all || f.type == type) && (f.is_const || f.is_static) && !f.brief_description.empty() )
show_modifiers = true;
show_modifiers = true;
}
out << "[table\n"
@ -833,7 +833,7 @@ void inline_str_with_links(std::string const& str, std::ostream & out)
first = false;
}
out << str[i];
}
}
}
else
{
@ -863,7 +863,7 @@ void inline_str_with_links(std::string const& str, std::ostream & out)
void quickbook_template_parameter_list_alt(std::vector<parameter> const& parameters, std::ostream& out)
{
std::string next_param;
if ( 2 < parameters.size() )
next_param = std::string("`,`\n") + " ";
else
@ -981,7 +981,7 @@ void quickbook_synopsis_alt(class_or_struct const& cos, configuration const& con
else
out << short_name.substr(last_scope + 2) << "`" << std::endl;
}
if (! cos.base_classes.empty())
{
out << "` : ";
@ -1080,7 +1080,7 @@ void quickbook_output_functions_details(std::vector<function> const& functions,
out << "[section " << replace_brackets(ss.str()) << "]" << std::endl;
quickbook_output_indexterm(f.name, out);
// Brief description
out << f.brief_description << std::endl;
out << std::endl;
@ -1174,7 +1174,7 @@ void quickbook_output_functions_details(std::vector<function> const& functions,
out << "[heading Returns]" << std::endl;
out << f.return_description << std::endl;
}
// Additional paragraphs, note, warning
output_paragraphs_note_warning(f, out);
@ -1276,7 +1276,7 @@ void quickbook_output_alt(documentation const& doc, configuration const& config,
{
out << "[endsect]" << std::endl
<< std::endl;
}
}
}
void quickbook_output_alt(class_or_struct const& cos, configuration const& config, std::ostream& out)

View File

@ -38,7 +38,7 @@ struct compile_bjam
static inline bool apply(int type1, int type2)
{
std::ostringstream command;
// For debugging:
// For debugging:
command << "bjam -a tmp > tmp/t" << type1 << "_" << type2 << ".out";
//command << "bjam -a tmp > tmp/t.out";
int failed = system(command.str().c_str());
@ -72,8 +72,8 @@ struct compile_msvc
}
command << "implementation_status.hpp tmp/t.cpp > tmp/t" //.out";
// For debugging:
<< type1 << "_" << type2 << ".out";
// For debugging:
<< type1 << "_" << type2 << ".out";
int failed = system(command.str().c_str());
return failed == 0;
@ -110,15 +110,15 @@ inline std::string typedef_string(int type, bool clockwise, bool open)
out << "bg::model::ring<P, "
<< bool_string(clockwise) << ", " << bool_string(open) << ">";
break;
case polygon :
case polygon :
out << "bg::model::polygon<P, "
<< bool_string(clockwise) << ", " << bool_string(open) << ">";
break;
case multi_point : return "bg::model::multi_point<P>";
case multi_linestring :
case multi_linestring :
out << "bg::model::multi_linestring<bg::model::linestring<P> >";
break;
case multi_polygon :
case multi_polygon :
out << "bg::model::multi_polygon<bg::model::polygon<P, "
<< bool_string(clockwise) << ", " << bool_string(open) << "> >";
break;
@ -134,7 +134,7 @@ inline std::string wkt_string(int type)
case linestring : return "LINESTRING(1 1,2 2)";
case segment : return "LINESTRING(1 1,2 2)";
case box : return "POLYGON((1 1,2 2)";
case polygon :
case polygon :
case ring :
return "POLYGON((0 0,0 1,1 1,0 0))";
case multi_point : return "MULTIPOINT((1 1),(2 2))";
@ -151,7 +151,7 @@ inline std::string geometry_string(int type)
case point : return "Point";
case linestring : return "Linestring";
case box : return "Box";
case polygon : return "Polygon";
case polygon : return "Polygon";
case ring : return "Ring";
case segment : return "Segment";
case multi_point : return "MultiPoint";
@ -176,9 +176,9 @@ int report_library(CompilePolicy& compile_policy,
{
out << "_" << geometry_string(type2);
}
out
out
<< "_" << algo.name
<< "_" << bool_string(clockwise)
<< "_" << bool_string(clockwise)
<< "_" << bool_string(open)
<< "_" << boost::replace_all_copy
(
@ -206,21 +206,21 @@ int report_library(CompilePolicy& compile_policy,
<< " " << typedef_string(type, clockwise, open) << " geometry;" << std::endl
<< " bg::read_wkt(\"" << wkt_string(type) << "\", geometry);" << std::endl;
if (algo.arity > 1)
{
out
out
<< " " << typedef_string(type2, clockwise, open) << " geometry2;" << std::endl
<< " bg::read_wkt(\"" << wkt_string(type2) << "\", geometry2);" << std::endl;
}
switch(algo.arity)
{
case 1 :
out << " bg::" << algo.name << "(geometry);" << std::endl;
case 1 :
out << " bg::" << algo.name << "(geometry);" << std::endl;
break;
case 2 :
out << " bg::" << algo.name << "(geometry, geometry2);" << std::endl;
case 2 :
out << " bg::" << algo.name << "(geometry, geometry2);" << std::endl;
break;
}

View File

@ -36,11 +36,11 @@ struct qbk_table_row_header
void operator()(G)
{
m_out
<< "["
<< "["
<< qbk_geometry_name
<
typename boost::geometry::tag<G>::type
>::name()
>::name()
<< "]";
}
};
@ -70,7 +70,7 @@ struct qbk_outputter
}
template <typename Types>
inline void table_header()
inline void table_header()
{
m_out << "[table" << std::endl << "[[ ]";
boost::mpl::for_each<Types>(qbk_table_row_header(m_out));
@ -81,25 +81,25 @@ struct qbk_outputter
m_out << "[table" << std::endl << "[[Geometry][Status]]" << std::endl;
}
inline void table_footer()
inline void table_footer()
{
m_out << "]" << std::endl;
}
template <typename G>
inline void begin_row()
inline void begin_row()
{
m_out
m_out
<< "[["
<< qbk_geometry_name
<
typename boost::geometry::tag<G>::type
>::name()
<< "]"
<< "]"
;
}
inline void end_row()
inline void end_row()
{
m_out << "]" << std::endl;
}