Base class for XML file objects. More...
Public Types | |
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... | |
Public Member Functions | |
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. | |
Private Member Functions | |
Generic (const Generic &)=delete | |
Generic & | operator= (const Generic &)=delete |
Generic (Generic &&)=delete | |
Generic & | operator= (Generic &&)=delete |
Private Attributes | |
LinkedListPointer | m_Link |
Linked list entry. | |
eType | m_eType |
Type of derived class. | |
Additional Inherited Members | |
Static Public Attributes inherited from Burger::Base | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Base class for XML file objects.
This base class is used to contain objects for XML files. It is used as is as a root object to start and end a linked list loop.
Enumeration to identify derived classes.
To remove the need for Run Time Type Information, all derived classes must self-identify by assigning themselves with a unique enumeration so a Generic class can be upcast to the true derived class.
Enumerator | |
---|---|
XML_ROOT | Only used for root objects. |
XML_COMMENT | "Comment" strings to retain user supplied information |
XML_CDATA | "CDATA" strings of data that is ignored by the parser |
XML_ATTRIBUTE | Attribute attached to a tag. |
XML_DECLARATION | XML declaration. |
XML_DOCUMENT | Document header (DTD) |
XML_ELEMENT | Data entries attached to a document header. |
XML_TEXT | Text content attached to a document. |
XML_UNKNOWN | Unknown XML entry. |
|
privatedelete |
|
privatedelete |
Burger::FileXML::Generic::Generic | ( | eType | uType | ) |
Initialize a generic object.
uType | Type enumeration for the derived class |
|
virtual |
Call the destructor for a generic object.
Unlink itself from the linked list and release resources
|
inline |
Get the pointer to the next object in the list.
Follow the linked list forward and get the item's pointer
Burger::FileXML::Element *BURGER_API Burger::FileXML::Generic::GetNextElement | ( | const char * | pElementName | ) | const |
Follow the linked list of items to the next named Element.
Starting from the supplied object, iterate over the linked list until either an Element with the requested name is found or a Root object is found. If it's a Root object, return NULL. Otherwise, return the pointer to the Element object.
pElementName | Pointer to a "C" string with the name of the requested Element |
Burger::FileXML::Element *BURGER_API Burger::FileXML::Generic::GetNextElement | ( | void | ) | const |
Burger::FileXML::Generic *BURGER_API Burger::FileXML::Generic::GetNextItem | ( | void | ) | const |
Follow the linked list of items to the next object.
Starting from the supplied object, iterate over the linked list one entry and if it's a Root object, return NULL. Otherwise, return the pointer to the Generic object.
|
inline |
Get the pointer to the previous object in the list.
Follow the linked list backward and get the item's pointer
|
inline |
|
inline |
Insert this object after this one in the linked list.
Add this object into the linked list AFTER this object. If this is the root object, it's effectively adding the new object to the start of the list.
pGeneric | Pointer to the Generic object to insert in the list after this one |
|
inline |
Insert this object before this one in the linked list.
Add this object into the linked list BEFORE this object. If this is the root object, it's effectively adding the new object to the end of the list.
pGeneric | Pointer to the Generic object to insert in the list before this one |
|
virtual |
Parse data from a data stream.
Parse data from the stream for this object and return zero if no error, or non-zero on error
pInput | Pointer to an input stream |
Reimplemented in Burger::FileXML::Attribute, Burger::FileXML::CData, Burger::FileXML::Comment, Burger::FileXML::Declaration, Burger::FileXML::Element, and Burger::FileXML::RawText.
|
virtual |
Write data to a data stream.
Write the contents of this object into the XML file
pOutput | Pointer to an output stream |
uDepth | Number of tabs to output before saving out this record |
Reimplemented in Burger::FileXML::Attribute, Burger::FileXML::CData, Burger::FileXML::Comment, Burger::FileXML::Declaration, Burger::FileXML::Element, and Burger::FileXML::RawText.
|
private |
Type of derived class.
|
private |
Linked list entry.