Nebula
Loading...
Searching...
No Matches
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 Nebula.

Public Member Functions

 BXmlLoaderUtil ()
 constructor
 
 ~BXmlLoaderUtil ()
 destructor
 
void SetupFromFileInMemory (void *buf, Stream::Size 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
 

Static Public Attributes

static const ushort InvalidNodeIndex = 0xffff
 
static const uint InvalidAttrIndex = 0xffffffff
 

Private Attributes

void * buffer
 
Stream::Size bufSize
 
BXMLFileHeaderheader
 
BXMLFileAttrattrs
 
BXMLFileNodenodes
 
Util::Array< const char * > stringTable
 
ushort curNodeIndex
 

Constructor & Destructor Documentation

◆ BXmlLoaderUtil()

IO::BXmlLoaderUtil::BXmlLoaderUtil ( )

constructor

◆ ~BXmlLoaderUtil()

IO::BXmlLoaderUtil::~BXmlLoaderUtil ( )

destructor

Member Function Documentation

◆ Discard()

void IO::BXmlLoaderUtil::Discard ( )

discard the object

◆ FindAttrIndex()

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!

◆ FindChildNodeIndex()

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.

◆ FindNodeIndex()

ushort IO::BXmlLoaderUtil::FindNodeIndex ( const char * path) const

find a node index by path

◆ FindSiblingNodeIndex()

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.

◆ GetAttrName()

const char * IO::BXmlLoaderUtil::GetAttrName ( uint attrIndex) const

get name of attribute by index

◆ GetAttrValue()

const char * IO::BXmlLoaderUtil::GetAttrValue ( uint attrIndex) const

get value of attribute by index

◆ GetCurrentNodeIndex()

ushort IO::BXmlLoaderUtil::GetCurrentNodeIndex ( ) const
inline

get current node index

◆ GetCurrentNodeName()

const char * IO::BXmlLoaderUtil::GetCurrentNodeName ( ) const
inline

get name of current node

◆ GetNodeName()

const char * IO::BXmlLoaderUtil::GetNodeName ( ushort nodeIndex) const

get name of a given node

◆ GetNumAttrs()

uint IO::BXmlLoaderUtil::GetNumAttrs ( ) const

get number of attributes on node

◆ GetParentNodeIndex()

ushort IO::BXmlLoaderUtil::GetParentNodeIndex ( ushort nodeIndex) const

get the parent node index of a node

◆ IsValid()

bool IO::BXmlLoaderUtil::IsValid ( ) const
inline

return true if the object has been setup

◆ SetCurrentNodeIndex()

void IO::BXmlLoaderUtil::SetCurrentNodeIndex ( ushort index)
inline

set cursor to node index

◆ SetToFirstChild()

bool IO::BXmlLoaderUtil::SetToFirstChild ( const char * name)

set cursor to first matching child node, name may point to empty string

◆ SetToNextChild()

bool IO::BXmlLoaderUtil::SetToNextChild ( const char * name)

set cursor to next matching child node, name may point to empty string

◆ SetToParent()

bool IO::BXmlLoaderUtil::SetToParent ( )

set to parent node

◆ SetupFromFileInMemory()

void IO::BXmlLoaderUtil::SetupFromFileInMemory ( void * buf,
Stream::Size size )

setup the object from a file-in-memory, buffer must remain intact until Discard() is called!

Member Data Documentation

◆ attrs

BXMLFileAttr* IO::BXmlLoaderUtil::attrs
private

◆ buffer

void* IO::BXmlLoaderUtil::buffer
private

◆ bufSize

Stream::Size IO::BXmlLoaderUtil::bufSize
private

◆ curNodeIndex

ushort IO::BXmlLoaderUtil::curNodeIndex
private

◆ header

BXMLFileHeader* IO::BXmlLoaderUtil::header
private

◆ InvalidAttrIndex

const uint IO::BXmlLoaderUtil::InvalidAttrIndex = 0xffffffff
static

◆ InvalidNodeIndex

const ushort IO::BXmlLoaderUtil::InvalidNodeIndex = 0xffff
static

◆ nodes

BXMLFileNode* IO::BXmlLoaderUtil::nodes
private

◆ stringTable

Util::Array<const char*> IO::BXmlLoaderUtil::stringTable
private

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