RenderTools::XMLNode Class Reference

#include <XMLNode.h>

List of all members.

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)


Detailed Description

Definition at line 21 of file XMLNode.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 
)

added to children through parent pointer in constructor

Definition at line 228 of file XMLNode.cpp.

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() 
)

scans 'up' through the parents until there is none

Definition at line 273 of file XMLNode.cpp.

const XMLNodePtr RenderTools::XMLNode::findRoot ( void   ) 

Definition at line 159 of file XMLNode.cpp.

const string RenderTools::XMLNode::getAttrib< string > ( const string  name  )  [inline]

specialize the string version

Definition at line 71 of file XMLNode.h.

const XMLNodePtr RenderTools::XMLNode::getChild ( const string  name  )  const

Definition at line 177 of file XMLNode.cpp.

template<class T >
const T RenderTools::XMLNode::getChildValue ( const string  name  )  [inline]

Definition at line 80 of file XMLNode.h.

const string RenderTools::XMLNode::getFullName ( void   ) 

first the type attribute, if any

Definition at line 219 of file XMLNode.cpp.

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]

Definition at line 59 of file XMLNode.h.

shared_ptr< T > RenderTools::XMLNode::getSharedPtr ( void   )  [inline]

Definition at line 53 of file XMLNode.h.

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  ) 

value can be either a filename or an xml string

Definition at line 96 of file XMLNode.cpp.

template<>
void RenderTools::XMLNode::setAttrib ( const string  name,
const string  value 
) [inline]

specialize the string version

template<class T >
void RenderTools::XMLNode::setAttrib ( const string  name,
const T  value 
) [inline]

Definition at line 64 of file XMLNode.h.

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.


The documentation for this class was generated from the following files:

Generated on Wed Jan 26 00:15:36 2011 for RenderTools by  doxygen 1.5.8