Linked list root object. More...
Public Member Functions | |
Root () | |
Create an empty root object. | |
virtual | ~Root () |
Call the destructor for a Root object. | |
uint_t | ParseList (InputMemoryStream *pInput, uint_t bAllowRawText=0) |
Parse XML objects from an XML text stream. | |
uint_t | SaveList (OutputMemoryStream *pOutput, uint_t uDepth) const |
Output all objects in a linked list. | |
void | DeleteList (void) |
Dispose of all objects in a linked list. | |
Generic * | FindType (eType uType) const |
Traverse the linked list and find a specific type. | |
void | DeleteType (eType uType) |
Traverse the linked list and delete all objects of a specific type. | |
const Element * | FindElement (const char *pElementName) const |
Traverse the linked list and find a specific named Element. | |
Element * | FindElement (const char *pElementName, uint_t bAlwaysCreate=0) |
Traverse the linked list and find a specific named Element. | |
Element * | AddElement (const char *pElementName) |
Allocate memory for a new Element and append it to the end of this list. | |
void | DeleteElement (const char *pElementName) |
Traverse the linked list and delete a specific named Element. | |
void | DeleteElements (const char *pElementName) |
Traverse the linked list and delete all Element objects of a specific name. | |
const Attribute * | FindAttribute (const char *pAttributeName) const |
Traverse the linked list and find a specific named Attribute. | |
Attribute * | FindAttribute (const char *pAttributeName, uint_t bAlwaysCreate=0) |
Traverse the linked list and find a specific named Attribute. | |
Attribute * | AddAttribute (const char *pAttributeName, const char *pValue=0) |
Allocate memory for a new Attribute and append it to the end of this list. | |
void | DeleteAttribute (const char *pAttributeName) |
Traverse the linked list and delete a specific named Attribute. | |
const RawText * | FindRawText (void) const |
Traverse the linked list and find the first occurrence of RawText. | |
RawText * | FindRawText (uint_t bAlwaysCreate=0) |
Traverse the linked list and find the first occurrence of RawText. | |
RawText * | AddRawText (const char *pValue=0) |
Allocate memory for a new RawText and append it to the end of this list. | |
void | DeleteRawText (void) |
Traverse the linked list and delete the first RawText entry located. | |
Public Member Functions inherited from Burger::FileXML::Generic | |
Generic (eType uType) | |
Initialize a generic object. | |
virtual | ~Generic () |
Call the destructor for a generic object. | |
virtual uint_t | Parse (InputMemoryStream *pInput) |
Parse data from a data stream. | |
virtual uint_t | Save (OutputMemoryStream *pOutput, uint_t uDepth) const |
Write data to a data stream. | |
Generic * | GetNext (void) const |
Get the pointer to the next object in the list. | |
Generic * | GetPrevious (void) const |
Get the pointer to the previous object in the list. | |
eType | GetType (void) const |
Get the enumeration of the derived class' type. | |
void | InsertBefore (Generic *pGeneric) |
Insert this object before this one in the linked list. | |
void | InsertAfter (Generic *pGeneric) |
Insert this object after this one in the linked list. | |
Element * | GetNextElement (void) const |
Follow the linked list of items to the next Element. | |
Element * | GetNextElement (const char *pElementName) const |
Follow the linked list of items to the next named Element. | |
Generic * | GetNextItem (void) const |
Follow the linked list of items to the next object. | |
Public Member Functions inherited from Burger::Base | |
const char * | get_class_name (void) const noexcept |
Get the name of the class. | |
virtual const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept |
Get the description to the class. | |
virtual | ~Base () noexcept=default |
Destructor. | |
Additional Inherited Members | |
Public Types inherited from Burger::FileXML::Generic | |
enum | eType { XML_ROOT , XML_COMMENT , XML_CDATA , XML_ATTRIBUTE , XML_DECLARATION , XML_DOCUMENT , XML_ELEMENT , XML_TEXT , XML_UNKNOWN } |
Enumeration to identify derived classes. More... | |
Static Public Attributes inherited from Burger::Base | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Linked list root object.
For every object that can contain other object, this object is the anchor that is the start and end of the linked list of contained object.
This object contains no data per se, only a list of other objects.
Burger::FileXML::Root::Root | ( | ) |
Create an empty root object.
|
virtual |
Burger::FileXML::Attribute *BURGER_API Burger::FileXML::Root::AddAttribute | ( | const char * | pAttributeName, |
const char * | pValue = 0 ) |
Allocate memory for a new Attribute and append it to the end of this list.
If an attribute of the same name exists in the host linked list, the pointer to the pre-existing attribute is updated.
pAttributeName | Pointer to a "C" string of the name of the attribute to create. |
pValue | Pointer to a "C" string of the name of the value for the attribute. |
Burger::FileXML::Element *BURGER_API Burger::FileXML::Root::AddElement | ( | const char * | pElementName | ) |
Allocate memory for a new Element and append it to the end of this list.
No attempt is made to determine if there are other elements with the same name.
pElementName | Pointer to a "C" string of the name of the element to create. |
Burger::FileXML::RawText *BURGER_API Burger::FileXML::Root::AddRawText | ( | const char * | pValue = 0 | ) |
Allocate memory for a new RawText and append it to the end of this list.
This will append a new record without checking if one already exists
pValue | Pointer to a "C" string of the value of the new text. |
void BURGER_API Burger::FileXML::Root::DeleteAttribute | ( | const char * | pAttributeName | ) |
Traverse the linked list and delete a specific named Attribute.
pAttributeName | Pointer to a "C" string of the name of the attribute to look for. |
void BURGER_API Burger::FileXML::Root::DeleteElement | ( | const char * | pElementName | ) |
Traverse the linked list and delete a specific named Element.
pElementName | Pointer to a "C" string of the name of the element to look for. |
void BURGER_API Burger::FileXML::Root::DeleteElements | ( | const char * | pElementName | ) |
Traverse the linked list and delete all Element objects of a specific name.
Iterate over the XML objects linked list and delete all Element objects of the requested name.
pElementName | Pointer to a "C" string to the Element's name (Can be multiple elements) |
void BURGER_API Burger::FileXML::Root::DeleteList | ( | void | ) |
Dispose of all objects in a linked list.
Assume the current object is a root object and iterate over all of the other XML objects linked to it and delete them.
void BURGER_API Burger::FileXML::Root::DeleteRawText | ( | void | ) |
Traverse the linked list and delete the first RawText entry located.
void BURGER_API Burger::FileXML::Root::DeleteType | ( | eType | uType | ) |
Traverse the linked list and delete all objects of a specific type.
Iterate over the XML objects linked list and delete all objects of the requested type.
uType | Type enumeration to scan for. |
const Burger::FileXML::Attribute *BURGER_API Burger::FileXML::Root::FindAttribute | ( | const char * | pAttributeName | ) | const |
Traverse the linked list and find a specific named Attribute.
Iterate over the XML objects linked list until an object of type XML_ROOT is found and abort. Return NULL if the element is not found or the pointer to the next occurrence of the named Attribute using a case sensitive string compare.
pAttributeName | Pointer to a "C" string of the name of the attribute to look for. |
Burger::FileXML::Attribute *BURGER_API Burger::FileXML::Root::FindAttribute | ( | const char * | pAttributeName, |
uint_t | bAlwaysCreate = 0 ) |
Traverse the linked list and find a specific named Attribute.
Iterate over the XML objects linked list until an object of type XML_ROOT is found and abort. Return NULL if the element is not found or the pointer to the next occurrence of the named Attribute using a case sensitive string compare.
pAttributeName | Pointer to a "C" string of the name of the attribute to look for. |
bAlwaysCreate | TRUE if the object can't be found, create an empty record instead |
const Burger::FileXML::Element *BURGER_API Burger::FileXML::Root::FindElement | ( | const char * | pElementName | ) | const |
Traverse the linked list and find a specific named Element.
Iterate over the XML objects linked list until an object of type XML_ROOT is found and abort. Return NULL if the element is not found or the pointer to the next occurrence of the named Element using a case sensitive string compare.
pElementName | Pointer to a "C" string of the name of the element to look for. |
Burger::FileXML::Element *BURGER_API Burger::FileXML::Root::FindElement | ( | const char * | pElementName, |
uint_t | bAlwaysCreate = 0 ) |
Traverse the linked list and find a specific named Element.
Iterate over the XML objects linked list until an object of type XML_ROOT is found and abort. Return NULL if the element is not found or the pointer to the next occurrence of the named Element using a case sensitive string compare.
pElementName | Pointer to a "C" string of the name of the element to look for. |
bAlwaysCreate | TRUE if the object can't be found, create an empty record instead |
Burger::FileXML::RawText *BURGER_API Burger::FileXML::Root::FindRawText | ( | uint_t | bAlwaysCreate = 0 | ) |
Traverse the linked list and find the first occurrence of RawText.
Iterate over the XML objects linked list until an object of type XML_ROOT is found and abort. Return NULL if the element is not found or the pointer to the next occurrence of the named RawText using a case sensitive string compare.
bAlwaysCreate | TRUE if the object can't be found, create an empty record instead |
const Burger::FileXML::RawText *BURGER_API Burger::FileXML::Root::FindRawText | ( | void | ) | const |
Burger::FileXML::Generic *BURGER_API Burger::FileXML::Root::FindType | ( | eType | uType | ) | const |
uint_t BURGER_API Burger::FileXML::Root::ParseList | ( | InputMemoryStream * | pInput, |
uint_t | bAllowRawText = 0 ) |
Parse XML objects from an XML text stream.
Parse the text and create XML objects based on the input. If there is an error in parsing, return a non-zero error code.
Parsing will continue until the end of input or a <// end parse token is found.
pInput | Pointer to an input stream |
bAllowRawText | If TRUE, then non-encapsulated text is allowed to be parsed since an Element is currently being parsed. |
uint_t BURGER_API Burger::FileXML::Root::SaveList | ( | OutputMemoryStream * | pOutput, |
uint_t | uDepth ) const |
Output all objects in a linked list.
Assume the current object is a root object and iterate over all of the other XML objects linked to it and save the contents to an output stream.
pOutput | Pointer to an output stream |
uDepth | Number of tabs to output before saving out this record |