3 //////////////////////////////////////////////////////////////////////
8 XMLNode::XMLNode (XMLNode
* pParent
, std::string name
, AttribMap attrib
)
9 : m_Node (name
), m_pParent (pParent
)
11 SetAttributes (attrib
);
14 void XMLNode::SetAttributes (AttribMap attrib
)
16 AttribMap::iterator itor
= attrib
.begin ();
17 for (; itor
!= attrib
.end (); ++itor
)
19 m_Node
.SetAttribute(itor
->first
, itor
->second
);
23 void XMLNode::AddChild (XMLNode
* pChild
)
25 m_Node
.InsertEndChild(pChild
->m_Node
);
28 void XMLNode::AddText (XMLText
* pContent
)
30 m_Node
.InsertEndChild(pContent
->m_Text
);
33 void XMLNode::SetText (std::string text
)
35 TiXmlText
xmlText (text
);
36 m_Node
.InsertEndChild(xmlText
);
42 m_pParent
->AddChild (this);
45 // ---------------------------------------------------------------
49 m_pParent
->AddText(this);
53 void XMLText::SetValue (std::string value
)
55 m_Text
.SetValue (value
);