VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes
makVrv::DtMetaFlightParser Class Reference

File responsible for parsing and traversing a metaflight xml file. More...

Public Member Functions

 DtMetaFlightParser ()
 CTOR.
bool openFile (const std::string &fileName, const std::string &virtualTextureFilename, std::string &parseError)
 Open a file.
const std::string & fileName () const
 Get the fileName of the master mft file.
const std::string & virtualTextureFileName () const
 Get the fileName of the virtual texture mft file.
const charcurrentElementType () const
 Intentionally using char *, to minimize data copying.
const charcurrentElementName () const
 Get the current element name.
const charcurrentElementReference () const
 Get the current element refTo value.
std::string currentElementNameOrGenerateUnique ()
 Get the current element name, if the element does not have a name generate a unique name.
const charcurrentElementText () const
 Get the current element text.
bool getCurrentElementValue (std::string &value) const
 Get the current element value as an string.
bool getCurrentElementValue (int &value) const
 Get the current element value as an integer.
bool getCurrentElementValue (unsigned int &value) const
 Get the current element value as an integer.
bool getCurrentElementValue (double &value) const
 Get the current element value as an integer.
unsigned int numberOfChildElements () const
 Get the number of child elements.
bool readFirstChildElement ()
 Move the internal point to the first child.
bool readNextElement ()
 Move the internal pointer to the next element (aka it's sibling).
bool readPreviousElement ()
 Move the internal pointer to the next element (aka it's sibling).
bool readParentElement ()
 Move the pointer back to the parent element.

Static Public Member Functions

static bool publish (const std::string &fileName, const std::string &virtualTextureFilename, const std::string &outputFileName, bool encryptingData, bool removeVT, std::string &parseError, bool extendGridLevelZero, float extendGridLevelZeroTo)
 Utility function for writing out a MetaFlight XML file which VRV can load.

Static Protected Member Functions

static xmlDocPtr createDocument (const std::string &file, std::string &parseError)
static int countChildrenWithName (xmlNodePtr node, const std::string &nodeName)
static xmlNodePtr findChildWithName (const xmlNodePtr node, const std::string &nodeName, const int occurance=0)
static void replaceAll (std::string &result, const std::string &replaceWhat, const std::string &replaceWithWhat)
static xmlNodePtr findDatabaseNode (xmlDocPtr xmlDocument, std::string &parseError)
static xmlNodePtr findChildWithAttribute (xmlNodePtr node, const std::string &nodeName, const std::string &attrName, const std::string &attrValue)
static const charattribute (xmlNodePtr node, const std::string &attrName)
static const chartext (xmlNodePtr node)
static bool setText (xmlNodePtr node, const std::string &text)

Protected Attributes

std::string myFileName
std::string myVirtualTextureFileName
xmlDocPtr myDocument
xmlNodePtr myCurrentNode
unsigned int myUniqueId

Detailed Description

File responsible for parsing and traversing a metaflight xml file.

Constructor & Destructor Documentation

makVrv::DtMetaFlightParser::DtMetaFlightParser ( )

CTOR.

Member Function Documentation

bool makVrv::DtMetaFlightParser::openFile ( const std::string &  fileName,
const std::string &  virtualTextureFilename,
std::string &  parseError 
)

Open a file.

const std::string& makVrv::DtMetaFlightParser::fileName ( ) const

Get the fileName of the master mft file.

const std::string& makVrv::DtMetaFlightParser::virtualTextureFileName ( ) const

Get the fileName of the virtual texture mft file.

If no vtfile name was specified this will return the same value as fileName.

static bool makVrv::DtMetaFlightParser::publish ( const std::string &  fileName,
const std::string &  virtualTextureFilename,
const std::string &  outputFileName,
bool  encryptingData,
bool  removeVT,
std::string &  parseError,
bool  extendGridLevelZero,
float  extendGridLevelZeroTo 
)
static

Utility function for writing out a MetaFlight XML file which VRV can load.

This function only writes out a single XML file.

const char* makVrv::DtMetaFlightParser::currentElementType ( ) const

Intentionally using char *, to minimize data copying.

const char* makVrv::DtMetaFlightParser::currentElementName ( ) const

Get the current element name.

const char* makVrv::DtMetaFlightParser::currentElementReference ( ) const

Get the current element refTo value.

std::string makVrv::DtMetaFlightParser::currentElementNameOrGenerateUnique ( )

Get the current element name, if the element does not have a name generate a unique name.

const char* makVrv::DtMetaFlightParser::currentElementText ( ) const

Get the current element text.

bool makVrv::DtMetaFlightParser::getCurrentElementValue ( std::string &  value) const

Get the current element value as an string.

bool makVrv::DtMetaFlightParser::getCurrentElementValue ( int value) const

Get the current element value as an integer.

bool makVrv::DtMetaFlightParser::getCurrentElementValue ( unsigned int value) const

Get the current element value as an integer.

bool makVrv::DtMetaFlightParser::getCurrentElementValue ( double value) const

Get the current element value as an integer.

unsigned int makVrv::DtMetaFlightParser::numberOfChildElements ( ) const

Get the number of child elements.

bool makVrv::DtMetaFlightParser::readFirstChildElement ( )

Move the internal point to the first child.

false if there are no children of the current element.

bool makVrv::DtMetaFlightParser::readNextElement ( )

Move the internal pointer to the next element (aka it's sibling).

bool makVrv::DtMetaFlightParser::readPreviousElement ( )

Move the internal pointer to the next element (aka it's sibling).

bool makVrv::DtMetaFlightParser::readParentElement ( )

Move the pointer back to the parent element.

static xmlDocPtr makVrv::DtMetaFlightParser::createDocument ( const std::string &  file,
std::string &  parseError 
)
staticprotected
static int makVrv::DtMetaFlightParser::countChildrenWithName ( xmlNodePtr  node,
const std::string &  nodeName 
)
staticprotected
static xmlNodePtr makVrv::DtMetaFlightParser::findChildWithName ( const xmlNodePtr  node,
const std::string &  nodeName,
const int  occurance = 0 
)
staticprotected
static void makVrv::DtMetaFlightParser::replaceAll ( std::string &  result,
const std::string &  replaceWhat,
const std::string &  replaceWithWhat 
)
staticprotected
static xmlNodePtr makVrv::DtMetaFlightParser::findDatabaseNode ( xmlDocPtr  xmlDocument,
std::string &  parseError 
)
staticprotected
static xmlNodePtr makVrv::DtMetaFlightParser::findChildWithAttribute ( xmlNodePtr  node,
const std::string &  nodeName,
const std::string &  attrName,
const std::string &  attrValue 
)
staticprotected
static const char* makVrv::DtMetaFlightParser::attribute ( xmlNodePtr  node,
const std::string &  attrName 
)
staticprotected
static const char* makVrv::DtMetaFlightParser::text ( xmlNodePtr  node)
staticprotected
static bool makVrv::DtMetaFlightParser::setText ( xmlNodePtr  node,
const std::string &  text 
)
staticprotected

Member Data Documentation

std::string makVrv::DtMetaFlightParser::myFileName
protected
std::string makVrv::DtMetaFlightParser::myVirtualTextureFileName
protected
xmlDocPtr makVrv::DtMetaFlightParser::myDocument
protected
xmlNodePtr makVrv::DtMetaFlightParser::myCurrentNode
protected
unsigned int makVrv::DtMetaFlightParser::myUniqueId
protected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)