Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75af6ab

Browse files
author
Davide Faconti
committed
changing namespace of tinyxml2
1 parent 47e1d5a commit 75af6ab

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

3rdparty/tinyXML2/tinyxml2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
116116
static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
117117
static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
118118

119-
namespace tinyxml2
119+
namespace BT_TinyXML2
120120
{
121121

122122
struct Entity {

3rdparty/tinyXML2/tinyxml2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static const int TIXML2_PATCH_VERSION = 1;
113113
// so there needs to be a limit in place.
114114
static const int TINYXML2_MAX_ELEMENT_DEPTH = 100;
115115

116-
namespace tinyxml2
116+
namespace BT_TinyXML2
117117
{
118118
class XMLDocument;
119119
class XMLElement;

src/xml_parsing.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
namespace BT
3737
{
38-
using namespace tinyxml2;
38+
using namespace BT_TinyXML2;
3939

4040
struct XMLParser::Pimpl
4141
{
@@ -48,9 +48,9 @@ struct XMLParser::Pimpl
4848
Blackboard::Ptr blackboard,
4949
const TreeNode::Ptr& root_parent);
5050

51-
void loadDocImpl(tinyxml2::XMLDocument* doc);
51+
void loadDocImpl(BT_TinyXML2::XMLDocument* doc);
5252

53-
std::list<std::unique_ptr<tinyxml2::XMLDocument> > opened_documents;
53+
std::list<std::unique_ptr<BT_TinyXML2::XMLDocument> > opened_documents;
5454
std::unordered_map<std::string,const XMLElement*> tree_roots;
5555

5656
const BehaviorTreeFactory& factory;
@@ -91,9 +91,9 @@ XMLParser::~XMLParser()
9191

9292
void XMLParser::loadFromFile(const std::string& filename)
9393
{
94-
_p->opened_documents.emplace_back(new tinyxml2::XMLDocument());
94+
_p->opened_documents.emplace_back(new BT_TinyXML2::XMLDocument());
9595

96-
tinyxml2::XMLDocument* doc = _p->opened_documents.back().get();
96+
BT_TinyXML2::XMLDocument* doc = _p->opened_documents.back().get();
9797
doc->LoadFile(filename.c_str());
9898

9999
filesystem::path file_path( filename );
@@ -104,15 +104,15 @@ void XMLParser::loadFromFile(const std::string& filename)
104104

105105
void XMLParser::loadFromText(const std::string& xml_text)
106106
{
107-
_p->opened_documents.emplace_back(new tinyxml2::XMLDocument());
107+
_p->opened_documents.emplace_back(new BT_TinyXML2::XMLDocument());
108108

109-
tinyxml2::XMLDocument* doc = _p->opened_documents.back().get();
109+
BT_TinyXML2::XMLDocument* doc = _p->opened_documents.back().get();
110110
doc->Parse(xml_text.c_str(), xml_text.size());
111111

112112
_p->loadDocImpl( doc );
113113
}
114114

115-
void XMLParser::Pimpl::loadDocImpl(tinyxml2::XMLDocument* doc)
115+
void XMLParser::Pimpl::loadDocImpl(BT_TinyXML2::XMLDocument* doc)
116116
{
117117
if (doc->Error())
118118
{
@@ -154,8 +154,8 @@ void XMLParser::Pimpl::loadDocImpl(tinyxml2::XMLDocument* doc)
154154
file_path = current_path / file_path;
155155
}
156156

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();
159159
next_doc->LoadFile(file_path.str().c_str());
160160
loadDocImpl(next_doc);
161161
}
@@ -196,7 +196,7 @@ void VerifyXML(const std::string& xml_text,
196196
const std::set<std::string>& registered_nodes)
197197
{
198198

199-
tinyxml2::XMLDocument doc;
199+
BT_TinyXML2::XMLDocument doc;
200200
auto xml_error = doc.Parse( xml_text.c_str(), xml_text.size());
201201
if (xml_error)
202202
{
@@ -648,9 +648,9 @@ void BT::XMLParser::Pimpl::recursivelyCreateTree(const std::string& tree_ID,
648648

649649
std::string writeTreeNodesModelXML(const BehaviorTreeFactory& factory)
650650
{
651-
using namespace tinyxml2;
651+
using namespace BT_TinyXML2;
652652

653-
tinyxml2::XMLDocument doc;
653+
BT_TinyXML2::XMLDocument doc;
654654

655655
XMLElement* rootXML = doc.NewElement("root");
656656
doc.InsertFirstChild(rootXML);

0 commit comments

Comments
 (0)