35
35
36
36
namespace BT
37
37
{
38
- using namespace tinyxml2 ;
38
+ using namespace BT_TinyXML2 ;
39
39
40
40
struct XMLParser ::Pimpl
41
41
{
@@ -48,9 +48,9 @@ struct XMLParser::Pimpl
48
48
Blackboard::Ptr blackboard,
49
49
const TreeNode::Ptr& root_parent);
50
50
51
- void loadDocImpl (tinyxml2 ::XMLDocument* doc);
51
+ void loadDocImpl (BT_TinyXML2 ::XMLDocument* doc);
52
52
53
- std::list<std::unique_ptr<tinyxml2 ::XMLDocument> > opened_documents;
53
+ std::list<std::unique_ptr<BT_TinyXML2 ::XMLDocument> > opened_documents;
54
54
std::unordered_map<std::string,const XMLElement*> tree_roots;
55
55
56
56
const BehaviorTreeFactory& factory;
@@ -91,9 +91,9 @@ XMLParser::~XMLParser()
91
91
92
92
void XMLParser::loadFromFile (const std::string& filename)
93
93
{
94
- _p->opened_documents .emplace_back (new tinyxml2 ::XMLDocument ());
94
+ _p->opened_documents .emplace_back (new BT_TinyXML2 ::XMLDocument ());
95
95
96
- tinyxml2 ::XMLDocument* doc = _p->opened_documents .back ().get ();
96
+ BT_TinyXML2 ::XMLDocument* doc = _p->opened_documents .back ().get ();
97
97
doc->LoadFile (filename.c_str ());
98
98
99
99
filesystem::path file_path ( filename );
@@ -104,15 +104,15 @@ void XMLParser::loadFromFile(const std::string& filename)
104
104
105
105
void XMLParser::loadFromText (const std::string& xml_text)
106
106
{
107
- _p->opened_documents .emplace_back (new tinyxml2 ::XMLDocument ());
107
+ _p->opened_documents .emplace_back (new BT_TinyXML2 ::XMLDocument ());
108
108
109
- tinyxml2 ::XMLDocument* doc = _p->opened_documents .back ().get ();
109
+ BT_TinyXML2 ::XMLDocument* doc = _p->opened_documents .back ().get ();
110
110
doc->Parse (xml_text.c_str (), xml_text.size ());
111
111
112
112
_p->loadDocImpl ( doc );
113
113
}
114
114
115
- void XMLParser::Pimpl::loadDocImpl (tinyxml2 ::XMLDocument* doc)
115
+ void XMLParser::Pimpl::loadDocImpl (BT_TinyXML2 ::XMLDocument* doc)
116
116
{
117
117
if (doc->Error ())
118
118
{
@@ -154,8 +154,8 @@ void XMLParser::Pimpl::loadDocImpl(tinyxml2::XMLDocument* doc)
154
154
file_path = current_path / file_path;
155
155
}
156
156
157
- opened_documents.emplace_back (new tinyxml2 ::XMLDocument ());
158
- tinyxml2 ::XMLDocument* next_doc = opened_documents.back ().get ();
157
+ opened_documents.emplace_back (new BT_TinyXML2 ::XMLDocument ());
158
+ BT_TinyXML2 ::XMLDocument* next_doc = opened_documents.back ().get ();
159
159
next_doc->LoadFile (file_path.str ().c_str ());
160
160
loadDocImpl (next_doc);
161
161
}
@@ -196,7 +196,7 @@ void VerifyXML(const std::string& xml_text,
196
196
const std::set<std::string>& registered_nodes)
197
197
{
198
198
199
- tinyxml2 ::XMLDocument doc;
199
+ BT_TinyXML2 ::XMLDocument doc;
200
200
auto xml_error = doc.Parse ( xml_text.c_str (), xml_text.size ());
201
201
if (xml_error)
202
202
{
@@ -648,9 +648,9 @@ void BT::XMLParser::Pimpl::recursivelyCreateTree(const std::string& tree_ID,
648
648
649
649
std::string writeTreeNodesModelXML (const BehaviorTreeFactory& factory)
650
650
{
651
- using namespace tinyxml2 ;
651
+ using namespace BT_TinyXML2 ;
652
652
653
- tinyxml2 ::XMLDocument doc;
653
+ BT_TinyXML2 ::XMLDocument doc;
654
654
655
655
XMLElement* rootXML = doc.NewElement (" root" );
656
656
doc.InsertFirstChild (rootXML);
0 commit comments