Skip to content

Commit 1c402dd

Browse files
author
Gaël Écorchard
committed
Remove tinyxml2:: prefix
Remove the tinyxml2:: prefix because the namespace is already imported. Signed-off-by: Gaël Écorchard <[email protected]>
1 parent 9d78398 commit 1c402dd

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

include/behaviortree_cpp/tree_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ inline Result TreeNode::getInput(const std::string& key, T& destination) const
400400
auto remap_it = config().input_ports.find(key);
401401
if (remap_it == config().input_ports.end())
402402
{
403-
return nonstd::make_unexpected(StrCat("getInput() failed because "
403+
return nonstd::make_unexpected(StrCat("getInput() of node `", fullPath(),
404+
"` failed because "
404405
"NodeConfig::input_ports "
405406
"does not contain the key: [",
406407
key, "]"));

src/xml_parsing.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ struct XMLParser::PImpl
105105
void getPortsRecursively(const XMLElement* element,
106106
std::vector<std::string>& output_ports);
107107

108-
void loadDocImpl(tinyxml2::XMLDocument* doc, bool add_includes);
108+
void loadDocImpl(XMLDocument* doc, bool add_includes);
109109

110-
std::list<std::unique_ptr<tinyxml2::XMLDocument> > opened_documents;
110+
std::list<std::unique_ptr<XMLDocument> > opened_documents;
111111
std::map<std::string, const XMLElement*> tree_roots;
112112

113113
const BehaviorTreeFactory& factory;
@@ -156,9 +156,9 @@ XMLParser::~XMLParser()
156156

157157
void XMLParser::loadFromFile(const std::filesystem::path& filepath, bool add_includes)
158158
{
159-
_p->opened_documents.emplace_back(new tinyxml2::XMLDocument());
159+
_p->opened_documents.emplace_back(new XMLDocument());
160160

161-
tinyxml2::XMLDocument* doc = _p->opened_documents.back().get();
161+
XMLDocument* doc = _p->opened_documents.back().get();
162162
doc->LoadFile(filepath.string().c_str());
163163

164164
_p->current_path = std::filesystem::absolute(filepath.parent_path());
@@ -168,9 +168,9 @@ void XMLParser::loadFromFile(const std::filesystem::path& filepath, bool add_inc
168168

169169
void XMLParser::loadFromText(const std::string& xml_text, bool add_includes)
170170
{
171-
_p->opened_documents.emplace_back(new tinyxml2::XMLDocument());
171+
_p->opened_documents.emplace_back(new XMLDocument());
172172

173-
tinyxml2::XMLDocument* doc = _p->opened_documents.back().get();
173+
XMLDocument* doc = _p->opened_documents.back().get();
174174
doc->Parse(xml_text.c_str(), xml_text.size());
175175

176176
_p->loadDocImpl(doc, add_includes);
@@ -231,7 +231,7 @@ void BT::XMLParser::PImpl::loadSubtreeModel(const XMLElement* xml_root)
231231
}
232232
}
233233

234-
void XMLParser::PImpl::loadDocImpl(tinyxml2::XMLDocument* doc, bool add_includes)
234+
void XMLParser::PImpl::loadDocImpl(XMLDocument* doc, bool add_includes)
235235
{
236236
if (doc->Error())
237237
{
@@ -290,8 +290,8 @@ void XMLParser::PImpl::loadDocImpl(tinyxml2::XMLDocument* doc, bool add_includes
290290
file_path = current_path / file_path;
291291
}
292292

293-
opened_documents.emplace_back(new tinyxml2::XMLDocument());
294-
tinyxml2::XMLDocument* next_doc = opened_documents.back().get();
293+
opened_documents.emplace_back(new XMLDocument());
294+
XMLDocument* next_doc = opened_documents.back().get();
295295

296296
// change current path to the included file for handling additional relative paths
297297
const auto previous_path = current_path;
@@ -341,7 +341,7 @@ void XMLParser::PImpl::loadDocImpl(tinyxml2::XMLDocument* doc, bool add_includes
341341
void VerifyXML(const std::string& xml_text,
342342
const std::unordered_map<std::string, BT::NodeType>& registered_nodes)
343343
{
344-
tinyxml2::XMLDocument doc;
344+
XMLDocument doc;
345345
auto xml_error = doc.Parse(xml_text.c_str(), xml_text.size());
346346
if (xml_error)
347347
{

0 commit comments

Comments
 (0)