Nebula
Loading...
Searching...
No Matches
IO::BXmlReader Class Reference

#include <bxmlreader.h>

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.

Inherits IO::StreamReader.

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::vec2 GetVec2 (const char *attr) const
 get vec2 attribute value from current node
 
Math::vec4 GetVec4 (const char *attr) const
 get vec4 attribute value from current node
 
Math::mat4 GetMat4 (const char *attr) const
 get mat4 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::vec2 GetOptVec2 (const char *attr, const Math::vec2 &defaultValue) const
 get vec2 attribute value from current node
 
Math::vec4 GetOptVec4 (const char *attr, const Math::vec4 &defaultValue) const
 get optional vec4 attribute value from current node
 
Math::float2 GetOptVec2 (const char *attr, const Math::float2 &defaultValue) const
 get vec2 attribute value from current node
 
Math::float4 GetOptVec4 (const char *attr, const Math::float4 &defaultValue) const
 get optional vec4 attribute value from current node
 
Math::mat4 GetOptMat4 (const char *attr, const Math::mat4 &defaultValue) const
 get optional mat4 attribute value from current node
 
- Public Member Functions inherited from IO::StreamReader
 StreamReader ()
 constructor
 
virtual ~StreamReader ()
 destructor
 
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
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
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
 

Private Member Functions

 __DeclareClass (BXmlReader)
 

Private Attributes

BXmlLoaderUtil loaderUtil
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 
- Protected Attributes inherited from IO::StreamReader
Ptr< Streamstream
 
bool isOpen
 
bool streamWasOpen
 

Constructor & Destructor Documentation

◆ BXmlReader()

IO::BXmlReader::BXmlReader ( )

constructor

◆ ~BXmlReader()

IO::BXmlReader::~BXmlReader ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

IO::BXmlReader::__DeclareClass ( BXmlReader )
private

◆ Close()

void IO::BXmlReader::Close ( )
virtual

end reading from the stream

Reimplemented from IO::StreamReader.

◆ Get()

template<typename T >
T IO::BXmlReader::Get ( const char * attr) const

generic getter for extension types

◆ GetAttrs()

Array< String > IO::BXmlReader::GetAttrs ( ) const

return names of all attrs on current node

◆ GetBool()

bool IO::BXmlReader::GetBool ( const char * attr) const

get bool attribute value from current node

◆ GetCurrentNodeName()

String IO::BXmlReader::GetCurrentNodeName ( ) const

get short name of current node

◆ GetCurrentNodePath()

String IO::BXmlReader::GetCurrentNodePath ( ) const

get path to current node

◆ GetFloat()

float IO::BXmlReader::GetFloat ( const char * attr) const

get float attribute value from current node

◆ GetInt()

int IO::BXmlReader::GetInt ( const char * attr) const

get int attribute value from current node

◆ GetMat4()

Math::mat4 IO::BXmlReader::GetMat4 ( const char * attr) const

get mat4 attribute value from current node

◆ GetOptBool()

bool IO::BXmlReader::GetOptBool ( const char * attr,
bool defaultValue ) const

get optional bool attribute value from current node

◆ GetOptFloat()

float IO::BXmlReader::GetOptFloat ( const char * attr,
float defaultValue ) const

get optional float attribute value from current node

◆ GetOptInt()

int IO::BXmlReader::GetOptInt ( const char * attr,
int defaultValue ) const

get optional int attribute value from current node

◆ GetOptMat4()

Math::mat4 IO::BXmlReader::GetOptMat4 ( const char * attr,
const Math::mat4 & defaultValue ) const

get optional mat4 attribute value from current node

◆ GetOptString()

String IO::BXmlReader::GetOptString ( const char * attr,
const Util::String & defaultValue ) const

get optional string attribute value from current node

◆ GetOptVec2() [1/2]

Math::float2 IO::BXmlReader::GetOptVec2 ( const char * attr,
const Math::float2 & defaultValue ) const

get vec2 attribute value from current node

◆ GetOptVec2() [2/2]

Math::vec2 IO::BXmlReader::GetOptVec2 ( const char * attr,
const Math::vec2 & defaultValue ) const

get vec2 attribute value from current node

◆ GetOptVec4() [1/2]

Math::float4 IO::BXmlReader::GetOptVec4 ( const char * attr,
const Math::float4 & defaultValue ) const

get optional vec4 attribute value from current node

◆ GetOptVec4() [2/2]

Math::vec4 IO::BXmlReader::GetOptVec4 ( const char * attr,
const Math::vec4 & defaultValue ) const

get optional vec4 attribute value from current node

◆ GetString()

String IO::BXmlReader::GetString ( const char * attr) const

get string attribute value from current node

◆ GetVec2()

Math::vec2 IO::BXmlReader::GetVec2 ( const char * attr) const

get vec2 attribute value from current node

◆ GetVec4()

Math::vec4 IO::BXmlReader::GetVec4 ( const char * attr) const

get vec4 attribute value from current node

◆ HasAttr()

bool IO::BXmlReader::HasAttr ( const char * attr) const

return true if matching attribute exists on current node

◆ HasNode()

bool IO::BXmlReader::HasNode ( const Util::String & path) const

return true if node exists

◆ Open()

bool IO::BXmlReader::Open ( )
virtual

begin reading from the stream

Reimplemented from IO::StreamReader.

◆ SetToFirstChild()

bool IO::BXmlReader::SetToFirstChild ( const Util::String & name = "")

set current node to first child node, return false if no child exists

◆ SetToNextChild()

bool IO::BXmlReader::SetToNextChild ( const Util::String & name = "")

set current node to next sibling node, return false if no more sibling exists

◆ SetToNode()

void IO::BXmlReader::SetToNode ( const Util::String & path)

set current node as path

◆ SetToParent()

bool IO::BXmlReader::SetToParent ( )

set current node to parent, return false if no parent exists

Member Data Documentation

◆ loaderUtil

BXmlLoaderUtil IO::BXmlReader::loaderUtil
private

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