Nebula
|
#include <bxmlloaderutil.h>
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 |
BXMLFileHeader * | header |
BXMLFileAttr * | attrs |
BXMLFileNode * | nodes |
Util::Array< const char * > | stringTable |
ushort | curNodeIndex |
IO::BXmlLoaderUtil::BXmlLoaderUtil | ( | ) |
constructor
IO::BXmlLoaderUtil::~BXmlLoaderUtil | ( | ) |
destructor
void IO::BXmlLoaderUtil::Discard | ( | ) |
discard the object
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!
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::FindNodeIndex | ( | const char * | path | ) | const |
find a node index by path
find a sibling node index by name, name may point to empty string
NOTE: childName may be 0 or point to an empty string.
const char * IO::BXmlLoaderUtil::GetAttrName | ( | uint | attrIndex | ) | const |
get name of attribute by index
const char * IO::BXmlLoaderUtil::GetAttrValue | ( | uint | attrIndex | ) | const |
get value of attribute by index
|
inline |
get current node index
|
inline |
get name of current node
const char * IO::BXmlLoaderUtil::GetNodeName | ( | ushort | nodeIndex | ) | const |
get name of a given node
uint IO::BXmlLoaderUtil::GetNumAttrs | ( | ) | const |
get number of attributes on node
get the parent node index of a node
|
inline |
return true if the object has been setup
|
inline |
set cursor to node index
bool IO::BXmlLoaderUtil::SetToFirstChild | ( | const char * | name | ) |
set cursor to first matching child node, name may point to empty string
bool IO::BXmlLoaderUtil::SetToNextChild | ( | const char * | name | ) |
set cursor to next matching child node, name may point to empty string
bool IO::BXmlLoaderUtil::SetToParent | ( | ) |
set to parent node
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!
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
|
private |