AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzXmlNode Struct Reference

An Xml node, e.g. <XmlNode></XmlNode> More...

#include <CzXml.h>

List of all members.

Public Types

typedef CzXmlNodeList::iterator _Iterator
typedef
CzXmlAttributeList::iterator 
_AttribIterator

Public Member Functions

_Iterator begin ()
_Iterator end ()
_AttribIterator attribs_begin ()
_AttribIterator attribs_end ()
 CzXmlNode ()
virtual ~CzXmlNode ()
void Clear ()
void AddChild (CzXmlNode *node)
void RemoveChild (CzXmlNode *node)
void AddAttribute (CzXmlAttribute *attribute)
 Adds an attribute to this node.
void AddAttribute (const CzString &name, const CzString &value, CzXmlParser *parser)
 Adds an attribute to this node.
void AddAttribute (const CzString &name, const char *value, CzXmlParser *parser)
 Adds an attribute to this node.
void UpdateAttribute (const CzString &name, const char *value, CzXmlParser *parser)
 Updates an existing named attribute in this node.
void SetName (const char *name)
void SetName (const char *name, int len)
void SetValue (const char *value)
void SetValue (const char *value, int len)
const CzStringGetName () const
 Gets the nodes name.
const CzStringgetValue () const
 Gets the nodes value.
int getValueAsInt () const
 Gets the nodes value as an integer.
float getValueAsFloat () const
 Gets the nodes value as a floating point number.
bool getValueAsBool () const
 Gets the nodes value as a boolean.
CzXmlParsergetParser ()
 Returns the parser that created this node.
void setParser (CzXmlParser *parser)
 Sets the parser that created this node.
void PrintAttributes (CzString &out)
 Print node attributes to a string.
void PrintTree (CzString &out, int level=0)
 Print entire tree to a string.
CzXmlNodegetFirstNode ()
 Get first child node.
CzXmlNodegetFirstNamedNode (unsigned int name_hash)
 Get first occurrence of a node in this node and all children.
void getNamedNodes (unsigned int name_hash, CzXmlNodeList *nodes)
 Get all occurrences of a node in this node and all children.
int getAttributeCount () const
 Returns number of attributes that the node contains.
CzXmlAttributegetAttribute (const char *name)
 Returns named attribute.
CzXmlAttributegetAttribute (unsigned int hash)
 Returns named attribute.
CzXmlAttributegetAttributeAtInex (int index)
 Returns attribute at the specified index.
int SaveAttributes (CzFile *file)
 Saves the attributes to a file.
int SaveTree (CzFile *file, int level=0)
 Saves entire node tree to a file.
int Save (const char *filename)
 Saves entire node tree to a file with the specified filename.
const char * getParserFileName () const
 Returns the name of the file that is being parsed.
void ToLower (bool recursive)
 Changes tags and attributes names to lower case, does not affect values.
void ToUpper (bool recursive)
 Changes tags and attributes names to upper case, does not affect values.
CzXmlNodeClone (CzXmlNode *parent)
 Clones this node.
CzXmlNodeCloneTree (CzXmlNode *parent)
 Clones the entire tree.

Public Attributes

bool Managed
 Managec nodes are managed by the pools system and should not be deleted.
bool HasValue
 Determines if value is valid.
uint16 Line
 File line.
CzString Name
 Node name.
CzString Value
 Node value.
CzXmlAttributeList Attributes
 List of attributes associated with this node.
CzXmlNodeParent
 Parent node.
CzXmlNodeList Children
 List of children nodes.
CzXmlParserParser
 Parser that created this node.

Detailed Description

An Xml node, e.g. <XmlNode></XmlNode>


Member Typedef Documentation

typedef CzXmlAttributeList::iterator CzXmlNode::_AttribIterator
typedef CzXmlNodeList::iterator CzXmlNode::_Iterator

Constructor & Destructor Documentation

CzXmlNode::CzXmlNode ( ) [inline]
CzXmlNode::~CzXmlNode ( ) [virtual]

Member Function Documentation

void CzXmlNode::AddAttribute ( CzXmlAttribute attribute)

Adds an attribute to this node.

void CzXmlNode::AddAttribute ( const CzString name,
const CzString value,
CzXmlParser parser 
)

Adds an attribute to this node.

void CzXmlNode::AddAttribute ( const CzString name,
const char *  value,
CzXmlParser parser 
)

Adds an attribute to this node.

void CzXmlNode::AddChild ( CzXmlNode node) [inline]
Parameters:
nodeAdds a child node to the tree
void CzXmlNode::Clear ( ) [inline]

Clones this node.

Clones the entire tree.

_Iterator CzXmlNode::end ( ) [inline]
CzXmlAttribute * CzXmlNode::getAttribute ( const char *  name)

Returns named attribute.

CzXmlAttribute * CzXmlNode::getAttribute ( unsigned int  hash)

Returns named attribute.

Returns attribute at the specified index.

int CzXmlNode::getAttributeCount ( ) const [inline]

Returns number of attributes that the node contains.

CzXmlNode * CzXmlNode::getFirstNamedNode ( unsigned int  name_hash)

Get first occurrence of a node in this node and all children.

Get first child node.

const CzString& CzXmlNode::GetName ( ) const [inline]

Gets the nodes name.

void CzXmlNode::getNamedNodes ( unsigned int  name_hash,
CzXmlNodeList nodes 
)

Get all occurrences of a node in this node and all children.

Returns the parser that created this node.

const char * CzXmlNode::getParserFileName ( ) const

Returns the name of the file that is being parsed.

const CzString& CzXmlNode::getValue ( ) const [inline]

Gets the nodes value.

bool CzXmlNode::getValueAsBool ( ) const

Gets the nodes value as a boolean.

float CzXmlNode::getValueAsFloat ( ) const

Gets the nodes value as a floating point number.

int CzXmlNode::getValueAsInt ( ) const

Gets the nodes value as an integer.

Print node attributes to a string.

void CzXmlNode::PrintTree ( CzString out,
int  level = 0 
)

Print entire tree to a string.

void CzXmlNode::RemoveChild ( CzXmlNode node) [inline]
Parameters:
nodeRemove a child node from the tree (does not destroy it)
int CzXmlNode::Save ( const char *  filename)

Saves entire node tree to a file with the specified filename.

Saves the attributes to a file.

int CzXmlNode::SaveTree ( CzFile file,
int  level = 0 
)

Saves entire node tree to a file.

void CzXmlNode::SetName ( const char *  name) [inline]
Parameters:
nameSets the nodes name
void CzXmlNode::SetName ( const char *  name,
int  len 
) [inline]
Parameters:
lenSets the nodes name
void CzXmlNode::setParser ( CzXmlParser parser) [inline]

Sets the parser that created this node.

void CzXmlNode::SetValue ( const char *  value) [inline]
Parameters:
valueSets the nodes value
void CzXmlNode::SetValue ( const char *  value,
int  len 
) [inline]
Parameters:
lenSets the nodes value
void CzXmlNode::ToLower ( bool  recursive)

Changes tags and attributes names to lower case, does not affect values.

void CzXmlNode::ToUpper ( bool  recursive)

Changes tags and attributes names to upper case, does not affect values.

void CzXmlNode::UpdateAttribute ( const CzString name,
const char *  value,
CzXmlParser parser 
)

Updates an existing named attribute in this node.


Member Data Documentation

List of attributes associated with this node.

List of children nodes.

Determines if value is valid.

File line.

Managec nodes are managed by the pools system and should not be deleted.

Parser that created this node.


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