The Nebula Device 3: IO::BXmlLoaderUtil Class Reference

The Nebula Device 3

IO::BXmlLoaderUtil Class Reference

#include <bxmlloaderutil.h>


Detailed Description

Helper class for loading binary xml files created with N3's binaryxmlconverter3 tool. BXmlLoaderUtil objects are usually not used directly, but are wrapped by higher level classes like XmlReader.

Uses raw char pointers so that the class can both be used with Nebula2 and Nebula3.

(C) 2009 Radon Labs GmbH

Public Member Functions

 BXmlLoaderUtil ()
 constructor
 ~BXmlLoaderUtil ()
 destructor
void SetupFromFileInMemory (void *buf, SizeT size)
 setup the object from a file-in-memory, buffer must remain intact until Discard() is called!
void Discard ()
 discard the object
bool IsValid () const
 return true if the object has been setup
ushort FindNodeIndex (const char *path) const
 find a node index by path
void SetCurrentNodeIndex (ushort index)
 set cursor to node index
ushort GetCurrentNodeIndex () const
 get current node index
const char * GetCurrentNodeName () const
 get name of current node
bool SetToFirstChild (const char *name)
 set cursor to first matching child node, name may point to empty string
bool SetToNextChild (const char *name)
 set cursor to next matching child node, name may point to empty string
bool SetToParent ()
 set to parent node
uint FindAttrIndex (const char *attrName) const
 find attribute index by name
uint GetNumAttrs () const
 get number of attributes on node
const char * GetAttrName (uint attrIndex) const
 get name of attribute by index
const char * GetAttrValue (uint attrIndex) const
 get value of attribute by index
ushort FindChildNodeIndex (ushort nodeIndex, const char *childName) const
 find a child node index by name, name may point to empty string
ushort FindSiblingNodeIndex (ushort nodeIndex, const char *sibName) const
 find a sibling node index by name, name may point to empty string
ushort GetParentNodeIndex (ushort nodeIndex) const
 get the parent node index of a node
const char * GetNodeName (ushort nodeIndex) const
 get name of a given node

Member Function Documentation

uint IO::BXmlLoaderUtil::FindAttrIndex ( const char *  attrName  )  const

find attribute index by name

Returns a local attribute index by name, this is NOT an index into the global attributes array!

ushort IO::BXmlLoaderUtil::FindChildNodeIndex ( ushort  nodeIndex,
const char *  childName 
) const

find a child node index by name, name may point to empty string

NOTE: childName may be 0 or point to an empty string

ushort IO::BXmlLoaderUtil::FindSiblingNodeIndex ( ushort  nodeIndex,
const char *  sibName 
) const

find a sibling node index by name, name may point to empty string

NOTE: childName may be 0 or point to an empty string