VR-Vantage 2.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
clXML Class Reference

Public Member Functions

 clXML (void)
virtual ~clXML (void)
 clXML (const clXML &obj)
 clXML (const clXMLNode &obj)
clXML operator= (const clXML &obj)
bool operator== (const clXML &obj)
bool operator!= (const clXML &obj)
virtual clXMLNodepaste (const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodecut (const char *byName)
virtual void reset ()
virtual bool archive (const char *filepath)
virtual bool serialize (const char *filepath)
virtual bool loadFromString (const char *xmlString)
virtual char * parse (char *XMLDocument)
virtual char * updateDocument ()
virtual char * getXMLDocumentStr ()
virtual clXMLNodeinsertElement (const clXMLNode &xmlElement, const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodeinsertElement (const clXML &xmlElement, const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodeinsertElement (const char *elementName, const int elementContent, const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodeinsertElement (const char *elementName, const double elementContent, const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodeinsertElement (const char *elementName, const char *elementContent=NULL, const char *priorTo=NULL, const char *parentElement=NULL, int childIdx=-1)
virtual clXMLNodeinsertElement (const std::string elementName, const std::string elementContent="", const std::string priorTo="", const std::string parentElement="", int childIdx=-1)
virtual clXMLNodeaddElement (const char *elementName, const char *elementContent=NULL, const char *parentElement=NULL)
 addElement *!
virtual clXMLNodeaddElement (const char *elementName, const int elementContent, const char *parentElement=NULL)
virtual clXMLNodeaddElement (const char *elementName, const double elementContent, const char *parentElement=NULL)
virtual clXMLNodeaddElement (const std::string elementName, const std::string elementContent="", const std::string parentElement="")
virtual clXMLNodeaddElement (const clXMLNode &xmlNode, const char *parentElement=NULL)
virtual clXMLNodeaddElement (const clXML &xmlElement, const char *parentElement=NULL)
virtual void removeElement (const char *byName, bool searchChildren=true)
virtual void removeElement (clXMLNode *byNode)
virtual clXMLNodefindElement (const char *byName, bool searchChildren=true)
virtual bool GetElementData (const char *byName, int &elementData)
virtual bool GetElementData (const char *byName, bool &elementData)
virtual bool GetElementData (const char *byName, double &elementData)
virtual bool GetElementData (const char *byName, char *(&elementData))
virtual bool SetElementData (const char *byName, const int elementData)
virtual bool SetElementData (const char *byName, const bool elementData)
virtual bool SetElementData (const char *byName, const double elementData)
virtual bool SetElementData (const char *byName, const char *elementData)
virtual clXML findDocument (const char *byName, bool searchChildren=true)
virtual int getNumTableEntries () const
virtual clXMLNodeget (int idx) const
virtual clXMLNodegetElement (int idx)
virtual bool isEmpty ()

Protected Member Functions

void init ()
void destroy ()
void copy (clXML *targ, const clXML &src)
clXMLNode ** createXMLTable ()

Protected Attributes

clXMLNode ** m_XMLDocument
int m_numTableEntries
char * m_XMLDocumentStr
clXMLNodem_clipboardDocument

Private Member Functions

virtual clXMLNode_insertElement (const clXMLNode &xmlNode, clXMLNode *priorTo=NULL, clXMLNode *parentElement=NULL, int childIdx=-1)
virtual clXMLNode_addElement (const clXMLNode &xmlNode, clXMLNode *parentElement=NULL)
virtual clXMLNode_addElement (const clXML &xmlElement, clXMLNode *parentElement=NULL)
virtual clXMLNode_insertElement (const clXML &xmlElement, clXMLNode *priorTo=NULL, clXMLNode *parentElement=NULL, int childIdx=-1)

Detailed Description

clXML class declaration

Description: clXML wraps up and maintains the XML nodes into a single document.

Constructor & Destructor Documentation

clXML::clXML ( void  )
virtual clXML::~clXML ( void  )
virtual
clXML::clXML ( const clXML obj)
clXML::clXML ( const clXMLNode obj)

Member Function Documentation

clXML clXML::operator= ( const clXML obj)
bool clXML::operator== ( const clXML obj)
bool clXML::operator!= ( const clXML obj)
virtual clXMLNode* clXML::paste ( const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Pastes (inserts) the clipboard XML document.
Parameters
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::cut ( const char *  byName)
virtual
Description:
Cuts (removes) the specified XML node from the document, along with any children it may own. The cut node is stored in a temporary pointer for later pasting.
Parameters
byName- name of the element to cut.
Returns
A pointer to the cut element.
Note
The pointer returned is temporary, and should not be stored.
virtual void clXML::reset ( )
virtual
Description:
Resets the XML object to its initial state.
Returns
void.
virtual bool clXML::archive ( const char *  filepath)
virtual
Description:
Saves the XML object data to file.
Parameters
filepath- complete file path and name to write file to.
Returns
true if sucessful
virtual bool clXML::serialize ( const char *  filepath)
virtual
Description:
Loads the XML object data from file.
Parameters
filepath- complete file path and name to read file from.
Returns
true if sucessful
virtual bool clXML::loadFromString ( const char *  xmlString)
virtual
Description:
Loads the XML object data from string.
Parameters
xmlString- string containing xml info
Returns
true if sucessful
virtual char* clXML::parse ( char *  XMLDocument)
virtual
Description:
Parses an XML document and builds the XML tree objects.
Parameters
XMLDocument- character data stream to parse.
Returns
A pointer to the XML document token.
Note
The pointer returned is temporary, and should not be stored.
virtual char* clXML::updateDocument ( )
virtual
Description:
Saves the node object data to character data stream.
Returns
A pointer to the current data stream.
Note
The pointer returned may be temporary, and should not be stored.
virtual char* clXML::getXMLDocumentStr ( )
virtual
Description:

returns XMLDocumentStr

virtual clXMLNode* clXML::_insertElement ( const clXMLNode xmlNode,
clXMLNode priorTo = NULL,
clXMLNode parentElement = NULL,
int  childIdx = -1 
)
privatevirtual
Description:
Inserts an XML element at the desired index. This is the base method all other inserts and adds should build upon.
Parameters
xmlNode- new node element.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::_addElement ( const clXMLNode xmlNode,
clXMLNode parentElement = NULL 
)
privatevirtual
Description:
Adds a XML node to the end of the list.
Parameters
xmlNode- XML node to insert into the XML table.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::_addElement ( const clXML xmlElement,
clXMLNode parentElement = NULL 
)
privatevirtual
Description:
Adds a XML node to the end of the list.
Parameters
xmlElement- an XML elemet to be insterted.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::_insertElement ( const clXML xmlElement,
clXMLNode priorTo = NULL,
clXMLNode parentElement = NULL,
int  childIdx = -1 
)
privatevirtual
Description:
Inserts an XML element at the desired index.
Parameters
xmlElement- an XML elemet to be insterted.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const clXMLNode xmlElement,
const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired position.
Parameters
xmlElement- an XML elemet to be insterted.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const clXML xmlElement,
const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired index.
Parameters
xmlElement- an XML elemet to be insterted.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const char *  elementName,
const int  elementContent,
const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired index.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const char *  elementName,
const double  elementContent,
const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired index.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const char *  elementName,
const char *  elementContent = NULL,
const char *  priorTo = NULL,
const char *  parentElement = NULL,
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired index.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::insertElement ( const std::string  elementName,
const std::string  elementContent = "",
const std::string  priorTo = "",
const std::string  parentElement = "",
int  childIdx = -1 
)
virtual
Description:
Inserts an XML element at the desired index.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
priorTo- element the new element will be inserted in front of.
parentElement- parent element of the new element.
childIdx- if the parent element is specified, the index to insert the child.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const char *  elementName,
const char *  elementContent = NULL,
const char *  parentElement = NULL 
)
virtual

addElement *!

Description:
Add an XML element to the end of the table.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const char *  elementName,
const int  elementContent,
const char *  parentElement = NULL 
)
virtual
Description:
Add an XML element to the end of the table.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const char *  elementName,
const double  elementContent,
const char *  parentElement = NULL 
)
virtual
Description:
Add an XML element to the end of the table.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const std::string  elementName,
const std::string  elementContent = "",
const std::string  parentElement = "" 
)
virtual
Description:
Add an XML element to the end of the table.
Parameters
elementName- name of the new element.
elementContent- data content of the new element.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const clXMLNode xmlNode,
const char *  parentElement = NULL 
)
virtual
Description:
Adds a XML node to the end of the list.
Parameters
xmlNode- XML node to insert into the XML table.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual clXMLNode* clXML::addElement ( const clXML xmlElement,
const char *  parentElement = NULL 
)
virtual
Description:
Adds a XML node to the end of the list.
Parameters
xmlElement- an XML elemet to be insterted.
parentElement- parent element of the new element.
Returns
A pointer to the new element.
Note
If priorTo = NULL, the insert will add the element to the tail of the list. If parentElement is defined, priorTo is ignored, and the new element is added as a child to parentElement. The pointer returned is temporary, and should not be stored.
virtual void clXML::removeElement ( const char *  byName,
bool  searchChildren = true 
)
virtual
Description:
Removes an XML element node from the table.
Parameters
byName- name of the element node to remove.
searchChildren- specifies the search to look in children nodes.
Returns
void.
virtual void clXML::removeElement ( clXMLNode byNode)
virtual
Description:
Removes an XML element node from the table.
Parameters
byNode- pointer to the element node to remove.
Returns
void.
virtual clXMLNode* clXML::findElement ( const char *  byName,
bool  searchChildren = true 
)
virtual
Description:
Attempts to locate a XML node element by name.
Parameters
byName- name of the element being searched for.
searchChildren- specifies the search to look in children nodes.
Returns
A pointer to the located node, or NULL.
Note
The pointer returned may be temporary, and should not be stored.
virtual bool clXML::GetElementData ( const char *  byName,
int elementData 
)
virtual
Description:
Attempts get the data from an element.
Parameters
byName- name of the element being searched for.
elementData- data to get.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::GetElementData ( const char *  byName,
bool elementData 
)
virtual
Description:
Attempts get the data from an element.
Parameters
byName- name of the element being searched for.
elementData- data to get.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::GetElementData ( const char *  byName,
double &  elementData 
)
virtual
Description:
Attempts get the data from an element.
Parameters
byName- name of the element being searched for.
elementData- data to get.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::GetElementData ( const char *  byName,
char *&  elementData 
)
virtual
Description:
Attempts get the data from an element.
Parameters
byName- name of the element being searched for.
elementData- data to get.
Returns
true if successful. False if not found, or the element is a parent.
Note
The pointer to elementData may be temporary, and should not be stored.
virtual bool clXML::SetElementData ( const char *  byName,
const int  elementData 
)
virtual
Description:
Attempts to set the data for an element.
Parameters
byName- name of the element being searched for.
elementData- data to set.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::SetElementData ( const char *  byName,
const bool  elementData 
)
virtual
Description:
Attempts to set the data for an element.
Parameters
byName- name of the element being searched for.
elementData- data to set.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::SetElementData ( const char *  byName,
const double  elementData 
)
virtual
Description:
Attempts to set the data for an element.
Parameters
byName- name of the element being searched for.
elementData- data to set.
Returns
true if successful. False if not found, or the element is a parent.
virtual bool clXML::SetElementData ( const char *  byName,
const char *  elementData 
)
virtual
Description:
Attempts to set the data for an element.
Parameters
byName- name of the element being searched for.
elementData- data to set.
Returns
true if successful. False if not found, or the element is a parent.
Note
The pointer to elementData may be temporary, and should not be stored.
virtual clXML clXML::findDocument ( const char *  byName,
bool  searchChildren = true 
)
virtual
Description:
Attempts to locate a XML document object by name.
Parameters
byName- name of the element being searched for.
searchChildren- specifies the search to look in children nodes.
Returns
A pointer to the located node, or NULL.
Note
The pointer returned may be temporary, and should not be stored.
virtual int clXML::getNumTableEntries ( ) const
virtual
Description:
Gets the number of XML table entries.
Returns
The number of XML table entries.
virtual clXMLNode* clXML::get ( int  idx) const
virtual
Description:
Gets the XML node located at the given index.
Parameters
idx- index of the desired node.
Returns
A pointer to the located node, or NULL.
Note
The pointer returned may be temporary, and should not be stored.
virtual clXMLNode* clXML::getElement ( int  idx)
virtual
Description:
Gets the XML element located at the given index.
Parameters
idx- index of the desired node.
Returns
A pointer to the located node, or NULL.
Note
The pointer returned may be temporary, and should not be stored.
virtual bool clXML::isEmpty ( )
virtual
Description:
Checks the document for content. If the document has no content, returns true.
Returns
true, if the document is empty.
void clXML::init ( )
protected
Description:
Initializes the class attributes.
Returns
void.
void clXML::destroy ( )
protected
Description:
Destroys the class object. Releases all memory in the target object and sets the memory space to 0.
Returns
void.
void clXML::copy ( clXML targ,
const clXML src 
)
protected
Description:
Copies the src object onto the target object.
Parameters
targ- target object to copy into.
src- src object data.
Returns
void.
clXMLNode** clXML::createXMLTable ( )
protected
Description:
Creates an empty list.
Returns
returns the pointer to the newly created list.

Member Data Documentation

clXMLNode** clXML::m_XMLDocument
protected
int clXML::m_numTableEntries
protected
char* clXML::m_XMLDocumentStr
protected
clXMLNode* clXML::m_clipboardDocument
protected

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


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)