Revert "rapidxml: don't report the line number (its not meaningful)"
This reverts commit f56121377e
.
This commit is contained in:
parent
f56121377e
commit
68f4906088
4 changed files with 7 additions and 11 deletions
|
@ -99,7 +99,7 @@ public:
|
|||
bool processed() const;
|
||||
void set_processed(bool processed) const;
|
||||
|
||||
int line() const;
|
||||
unsigned 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_;
|
||||
int line_;
|
||||
unsigned line_;
|
||||
mutable bool processed_;
|
||||
static std::string xml_text;
|
||||
};
|
||||
|
|
|
@ -1739,13 +1739,9 @@ 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() + "'";
|
||||
if (node.line() >= 0)
|
||||
{
|
||||
error_message += " at line " + node.line_to_string();
|
||||
}
|
||||
error_message += "\n* node '" + node.name() + "' 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();
|
||||
|
|
|
@ -122,7 +122,7 @@ private:
|
|||
{
|
||||
case rapidxml::node_element:
|
||||
{
|
||||
xml_node &new_node = node.add_child((char *)cur_node->name(), -1, false);
|
||||
xml_node &new_node = node.add_child((char *)cur_node->name(), 0, 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(), -1, true);
|
||||
node.add_child(cur_node->value(), 0, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -368,7 +368,7 @@ T xml_node::get_value() const
|
|||
return *result;
|
||||
}
|
||||
|
||||
int xml_node::line() const
|
||||
unsigned xml_node::line() const
|
||||
{
|
||||
return line_;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue