zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::XML_Element_c Class Reference

#include <XML.h>

Inherited by Zeni::XML_Element.

Public Member Functions

 XML_Element_c (const TiXmlHandle &handle)
 
XML_Element_c first () const
 Get the first subelement. More...
 
bool good () const
 Test to see if the Element is valid. More...
 
XML_Element_c next () const
 Get the next subelement. More...
 
XML_Element_c operator[] (const String &field) const
 Get a named subelement. More...
 
bool to_bool () const
 Get the contained string as a boolean. More...
 
double to_double () const
 Get the contained string as a double precision floating point number. More...
 
float to_float () const
 Get the contained string as a floating point number. More...
 
int to_int () const
 Get the contained string as an integer. More...
 
String to_string () const
 Get the contained string. More...
 
String value () const
 Get the value of the element (For nodes, this is the name) More...
 

Protected Member Functions

TiXmlNodechild (const String &field) const
 
TiXmlNodechild_element (const String &field) const
 
TiXmlNodefirst_child () const
 
TiXmlNodefirst_child_element () const
 

Protected Attributes

TiXmlHandle m_handle
 

Detailed Description

Definition at line 53 of file XML.h.

Constructor & Destructor Documentation

Zeni::XML_Element_c::XML_Element_c ( const TiXmlHandle handle)

Definition at line 29 of file XML.cpp.

Referenced by first(), next(), and operator[]().

Member Function Documentation

TiXmlNode * Zeni::XML_Element_c::child ( const String field) const
protected
TiXmlNode * Zeni::XML_Element_c::child_element ( const String field) const
protected
XML_Element_c Zeni::XML_Element_c::first ( ) const

Get the first subelement.

Definition at line 44 of file XML.cpp.

References first_child_element(), m_handle, TiXmlNode::ToElement(), TiXmlHandle::ToNode(), and XML_Element_c().

Referenced by Zeni::Database< TYPE >::load_file().

TiXmlNode * Zeni::XML_Element_c::first_child ( ) const
protected

Definition at line 125 of file XML.cpp.

References TiXmlNode::FirstChild(), m_handle, and TiXmlHandle::ToNode().

Referenced by Zeni::XML_Element::set_string().

TiXmlNode * Zeni::XML_Element_c::first_child_element ( ) const
protected

Definition at line 135 of file XML.cpp.

References TiXmlNode::FirstChildElement(), m_handle, and TiXmlHandle::ToNode().

Referenced by first(), and Zeni::XML_Element::first().

bool Zeni::XML_Element_c::good ( ) const

Test to see if the Element is valid.

Basic Element Functionality

Definition at line 64 of file XML.cpp.

References m_handle, and TiXmlHandle::ToElement().

Referenced by Zeni::Database< TYPE >::load_file(), Zeni::XML_Element::remove_child(), Zeni::XML_Element::set_string(), to_string(), and value().

XML_Element_c Zeni::XML_Element_c::next ( ) const

Get the next subelement.

Definition at line 54 of file XML.cpp.

References m_handle, TiXmlNode::NextSiblingElement(), TiXmlHandle::ToNode(), and XML_Element_c().

XML_Element_c Zeni::XML_Element_c::operator[] ( const String field) const

Get a named subelement.

Tree Traversal

Definition at line 34 of file XML.cpp.

References child_element(), m_handle, TiXmlNode::ToElement(), TiXmlHandle::ToNode(), and XML_Element_c().

bool Zeni::XML_Element_c::to_bool ( ) const

Get the contained string as a boolean.

Text Accessors

Definition at line 83 of file XML.cpp.

References to_int().

Referenced by load_config().

double Zeni::XML_Element_c::to_double ( ) const

Get the contained string as a double precision floating point number.

Definition at line 95 of file XML.cpp.

References to_string().

float Zeni::XML_Element_c::to_float ( ) const

Get the contained string as a floating point number.

Definition at line 91 of file XML.cpp.

References to_string().

int Zeni::XML_Element_c::to_int ( ) const

Get the contained string as an integer.

Definition at line 87 of file XML.cpp.

References to_string().

Referenced by load_config(), and to_bool().

String Zeni::XML_Element_c::to_string ( ) const

Get the contained string.

Definition at line 99 of file XML.cpp.

References TiXmlElement::GetText(), good(), m_handle, and TiXmlHandle::ToElement().

Referenced by load_config(), Zeni::Video::preinit_from_file(), to_double(), to_float(), and to_int().

String Zeni::XML_Element_c::value ( ) const

Get the value of the element (For nodes, this is the name)

Definition at line 68 of file XML.cpp.

References good(), m_handle, TiXmlHandle::ToElement(), and TiXmlNode::Value().

Member Data Documentation


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