The Nebula Device 3: IO::BXmlReader Class Reference

The Nebula Device 3

IO::BXmlReader Class Reference

#include <bxmlreader.h>

Inheritance diagram for IO::BXmlReader:

IO::StreamReader Core::RefCounted

Detailed Description

Stream reader for binary XML files. The interface is similar to XmlReader so that it is easy to switch between the 2 classes. Use the N3 tool binaryxmlconverter3.exe to convert an XML file to a binary XML file.

(C) 2009 Radon Labs GmbH

Public Member Functions

 BXmlReader ()
 constructor
virtual ~BXmlReader ()
 destructor
virtual bool Open ()
 begin reading from the stream
virtual void Close ()
 end reading from the stream
bool HasNode (const Util::String &path) const
 return true if node exists
Util::String GetCurrentNodeName () const
 get short name of current node
Util::String GetCurrentNodePath () const
 get path to current node
void SetToNode (const Util::String &path)
 set current node as path
bool SetToFirstChild (const Util::String &name="")
 set current node to first child node, return false if no child exists
bool SetToNextChild (const Util::String &name="")
 set current node to next sibling node, return false if no more sibling exists
bool SetToParent ()
 set current node to parent, return false if no parent exists
bool HasAttr (const char *attr) const
 return true if matching attribute exists on current node
Util::Array< Util::StringGetAttrs () const
 return names of all attrs on current node
Util::String GetString (const char *attr) const
 get string attribute value from current node
bool GetBool (const char *attr) const
 get bool attribute value from current node
int GetInt (const char *attr) const
 get int attribute value from current node
float GetFloat (const char *attr) const
 get float attribute value from current node
Math::float2 GetFloat2 (const char *attr) const
 get float2 attribute value from current node
Math::float4 GetFloat4 (const char *attr) const
 get float4 attribute value from current node
Math::matrix44 GetMatrix44 (const char *attr) const
 get matrix44 attribute value from current node
template<typename T>
Get (const char *attr) const
 generic getter for extension types
Util::String GetOptString (const char *attr, const Util::String &defaultValue) const
 get optional string attribute value from current node
bool GetOptBool (const char *attr, bool defaultValue) const
 get optional bool attribute value from current node
int GetOptInt (const char *attr, int defaultValue) const
 get optional int attribute value from current node
float GetOptFloat (const char *attr, float defaultValue) const
 get optional float attribute value from current node
Math::float2 GetOptFloat2 (const char *attr, const Math::float2 &defaultValue) const
 get float2 attribute value from current node
Math::float4 GetOptFloat4 (const char *attr, const Math::float4 &defaultValue) const
 get optional float4 attribute value from current node
Math::matrix44 GetOptMatrix44 (const char *attr, const Math::matrix44 &defaultValue) const
 get optional matrix44 attribute value from current node
void SetStream (const Ptr< Stream > &s)
 set stream to read from
const Ptr< Stream > & GetStream () const
 get currently set stream
bool HasStream () const
 return true if a stream is set
bool Eof () const
 return true if the stream has reached EOF
bool IsOpen () const
 return true if currently open
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Member Function Documentation

void IO::StreamReader::SetStream ( const Ptr< Stream > &  s  )  [inherited]

set stream to read from

Attaches the reader to a stream. This will imcrement the refcount of the stream.

Reimplemented in Messaging::MessageReader.

const Ptr< Stream > & IO::StreamReader::GetStream (  )  const [inherited]

get currently set stream

Get pointer to the attached stream. If there is no stream attached, an assertion will be thrown. Use HasStream() to determine if a stream is attached.

bool IO::StreamReader::HasStream (  )  const [inherited]

return true if a stream is set

Returns true if a stream is attached to the reader.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.