#include <XMLNode.h>
Public Member Functions | |
| XMLNode (void) | |
| XMLNode (const string tagname) | |
| virtual | ~XMLNode (void) |
| const string | toString (void) const |
| void | load (const string value) |
| bool | save (const string filename) |
| value can be either a filename or an xml string | |
| void | setParent (XMLNodePtr parent) |
| const XMLNodePtr | addChild (const string name, const string value) |
| const XMLNodePtr | addChild (const string className) |
| const XMLNodePtr | addChild (XMLNodePtr child) |
| void | setTagName (const string name) |
| const string | getTagName (void) const |
| bool | hasChildren (void) const |
| bool | isParent (const XMLNodePtr xml) const |
| bool | isChild (const XMLNodePtr xml) const |
| const XMLNodePtr | getParent (void) const |
| const XMLNodePtr | getChild (const string name) const |
| const XMLNodePtr | nextChild (const XMLNodePtr previous) const |
| XMLNodePtr | nextChild (XMLNodePtr previous) |
| const XMLNodePtr | findRoot (void) |
| const XMLNodePtr | findByFullName (const string className, const string propertyName, const XMLNodePtr xml=XMLNodePtr()) |
| scans 'up' through the parents until there is none | |
| const XMLNodePtr | findByFullName (const string fullName, const XMLNodePtr xml=XMLNodePtr()) |
| bool | hasAttrib (const string name) const |
| const string | getFullName (void) |
| shared_ptr< T > | getSharedPtr (void) |
| const shared_ptr< T > | getSharedPtr (void) const |
| template<class T > | |
| void | setAttrib (const string name, const T value) |
| template<class T > | |
| const T | getAttrib (const string name) |
| specialize the string version | |
| template<class T > | |
| const T | getChildValue (const string name) |
| template<> | |
| void | setAttrib (const string name, const string value) |
| specialize the string version | |
Static Public Member Functions | |
| static void | setVerbose (bool state=true) |
| static bool | isVerbose (void) |
Definition at line 21 of file XMLNode.h.
| RenderTools::XMLNode::XMLNode | ( | void | ) |
Definition at line 8 of file XMLNode.cpp.
| RenderTools::XMLNode::XMLNode | ( | const string | tagname | ) |
Definition at line 11 of file XMLNode.cpp.
| RenderTools::XMLNode::~XMLNode | ( | void | ) | [virtual] |
Definition at line 93 of file XMLNode.cpp.
| const XMLNodePtr RenderTools::XMLNode::addChild | ( | XMLNodePtr | child | ) |
Definition at line 246 of file XMLNode.cpp.
| const XMLNodePtr RenderTools::XMLNode::addChild | ( | const string | className | ) |
Definition at line 238 of file XMLNode.cpp.
| const XMLNodePtr RenderTools::XMLNode::addChild | ( | const string | name, | |
| const string | value | |||
| ) |
| const XMLNodePtr RenderTools::XMLNode::findByFullName | ( | const string | fullName, | |
| const XMLNodePtr | xml = XMLNodePtr() | |||
| ) |
return the first expanded node that describes a model (class)
Definition at line 277 of file XMLNode.cpp.
| const XMLNodePtr RenderTools::XMLNode::findByFullName | ( | const string | className, | |
| const string | propertyName, | |||
| const XMLNodePtr | xml = XMLNodePtr() | |||
| ) |
| const XMLNodePtr RenderTools::XMLNode::findRoot | ( | void | ) |
Definition at line 159 of file XMLNode.cpp.
| const string RenderTools::XMLNode::getAttrib< string > | ( | const string | name | ) | [inline] |
| const XMLNodePtr RenderTools::XMLNode::getChild | ( | const string | name | ) | const |
Definition at line 177 of file XMLNode.cpp.
| const T RenderTools::XMLNode::getChildValue | ( | const string | name | ) | [inline] |
| const string RenderTools::XMLNode::getFullName | ( | void | ) |
| const XMLNodePtr RenderTools::XMLNode::getParent | ( | void | ) | const |
Definition at line 155 of file XMLNode.cpp.
| const shared_ptr< T > RenderTools::XMLNode::getSharedPtr | ( | void | ) | const [inline] |
| shared_ptr< T > RenderTools::XMLNode::getSharedPtr | ( | void | ) | [inline] |
| const string RenderTools::XMLNode::getTagName | ( | void | ) | const |
Definition at line 169 of file XMLNode.cpp.
| bool RenderTools::XMLNode::hasAttrib | ( | const string | name | ) | const |
Definition at line 215 of file XMLNode.cpp.
| bool RenderTools::XMLNode::hasChildren | ( | void | ) | const |
Definition at line 173 of file XMLNode.cpp.
| bool RenderTools::XMLNode::isChild | ( | const XMLNodePtr | xml | ) | const |
Definition at line 252 of file XMLNode.cpp.
| bool RenderTools::XMLNode::isParent | ( | const XMLNodePtr | xml | ) | const |
Definition at line 261 of file XMLNode.cpp.
| bool RenderTools::XMLNode::isVerbose | ( | void | ) | [static] |
Definition at line 301 of file XMLNode.cpp.
| void RenderTools::XMLNode::load | ( | const string | value | ) |
but not if it starts with a '<'
if the file cannot be found
if its not a valid xml tag
we make it an xml tag
see if we can read it as a file
flush & close the file
null-terminate
if we cannot read it, interpret file as xml
null-terminate
Definition at line 15 of file XMLNode.cpp.
| XMLNodePtr RenderTools::XMLNode::nextChild | ( | XMLNodePtr | previous | ) |
Definition at line 201 of file XMLNode.cpp.
| const XMLNodePtr RenderTools::XMLNode::nextChild | ( | const XMLNodePtr | previous | ) | const |
Definition at line 187 of file XMLNode.cpp.
| bool RenderTools::XMLNode::save | ( | const string | filename | ) |
| void RenderTools::XMLNode::setAttrib | ( | const string | name, | |
| const string | value | |||
| ) | [inline] |
specialize the string version
| void RenderTools::XMLNode::setAttrib | ( | const string | name, | |
| const T | value | |||
| ) | [inline] |
| void RenderTools::XMLNode::setParent | ( | XMLNodePtr | parent | ) |
Definition at line 151 of file XMLNode.cpp.
| void RenderTools::XMLNode::setTagName | ( | const string | name | ) |
Definition at line 147 of file XMLNode.cpp.
| void RenderTools::XMLNode::setVerbose | ( | bool | state = true |
) | [static] |
Definition at line 297 of file XMLNode.cpp.
| const string RenderTools::XMLNode::toString | ( | void | ) | const |
open tag
add the attributes
close the tag immediately if no children
end the open tag
print the children
add a close tag
Definition at line 107 of file XMLNode.cpp.
1.5.8