rapidxml: don't report the line number (its not meaningful)

This commit is contained in:
Dane Springmeyer 2014-05-23 14:18:05 -07:00
parent 30c6bc53fb
commit f56121377e
4 changed files with 11 additions and 7 deletions

View file

@ -99,7 +99,7 @@ public:
bool processed() const;
void set_processed(bool processed) const;
unsigned line() const;
int line() const;
std::string line_to_string() const;
const_iterator begin() const;
@ -133,7 +133,7 @@ private:
std::list<xml_node> children_;
attribute_map attributes_;
bool is_text_;
unsigned line_;
int line_;
mutable bool processed_;
static std::string xml_text;
};

View file

@ -1739,9 +1739,13 @@ void map_parser::find_unused_nodes_recursive(xml_node const& node, std::string &
if (node.is_text()) {
error_message += "\n* text '" + node.text() + "'";
} else {
error_message += "\n* node '" + node.name() + "' at line " + node.line_to_string();
error_message += "\n* node '" + node.name() + "'";
if (node.line() >= 0)
{
error_message += " at line " + node.line_to_string();
}
}
return; //All attributes and children are automatically unprocessed, too.
return; // All attributes and children are automatically unprocessed, too.
}
xml_node::attribute_map const& attr = node.get_attributes();
xml_node::attribute_map::const_iterator aitr = attr.begin();

View file

@ -122,7 +122,7 @@ private:
{
case rapidxml::node_element:
{
xml_node &new_node = node.add_child((char *)cur_node->name(), 0, false);
xml_node &new_node = node.add_child((char *)cur_node->name(), -1, false);
// Copy attributes
for (rapidxml::xml_attribute<char> *attr = cur_node->first_attribute();
attr; attr = attr->next_attribute())
@ -145,7 +145,7 @@ private:
{
if (cur_node->value_size() > 0) // Don't add empty text nodes
{
node.add_child(cur_node->value(), 0, true);
node.add_child(cur_node->value(), -1, true);
}
}
break;

View file

@ -368,7 +368,7 @@ T xml_node::get_value() const
return *result;
}
unsigned xml_node::line() const
int xml_node::line() const
{
return line_;
}