Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::FileXML::Generic Class Reference

Base class for XML file objects. More...

Inheritance diagram for Burger::FileXML::Generic:
Collaboration diagram for Burger::FileXML::Generic:

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.
 
GenericGetNext (void) const
 Get the pointer to the next object in the list.
 
GenericGetPrevious (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.
 
ElementGetNextElement (void) const
 Follow the linked list of items to the next Element.
 
ElementGetNextElement (const char *pElementName) const
 Follow the linked list of items to the next named Element.
 
GenericGetNextItem (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::StaticRTTIget_StaticRTTI (void) const noexcept
 Get the description to the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Private Member Functions

 Generic (const Generic &)=delete
 
Genericoperator= (const Generic &)=delete
 
 Generic (Generic &&)=delete
 
Genericoperator= (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.
 

Detailed Description

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.

See also
FileXML, FileXML::Element, FileXML::Comment or FileXML::Attribute

Member Enumeration Documentation

◆ eType

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.

See also
FileXML, FileXML::Element, FileXML::Comment or FileXML::Attribute
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.

Constructor & Destructor Documentation

◆ Generic() [1/3]

Burger::FileXML::Generic::Generic ( const Generic & )
privatedelete

◆ Generic() [2/3]

Burger::FileXML::Generic::Generic ( Generic && )
privatedelete

◆ Generic() [3/3]

Burger::FileXML::Generic::Generic ( eType uType)

Initialize a generic object.


Parameters
uTypeType enumeration for the derived class

◆ ~Generic()

Burger::FileXML::Generic::~Generic ( )
virtual

Call the destructor for a generic object.


Unlink itself from the linked list and release resources

Note
This is a base class, so the destructor is virtual

Member Function Documentation

◆ GetNext()

Generic * Burger::FileXML::Generic::GetNext ( void ) const
inline

Get the pointer to the next object in the list.


Follow the linked list forward and get the item's pointer

Returns
Pointer to the next Generic object in the list
See also
GetPrevious(void) const

◆ GetNextElement() [1/2]

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.

Parameters
pElementNamePointer to a "C" string with the name of the requested Element
Returns
NULL if there are no more Element objects or a valid Element pointer
See also
GetNextItem(void) const or GetNextElement(void) const

◆ GetNextElement() [2/2]

Burger::FileXML::Element *BURGER_API Burger::FileXML::Generic::GetNextElement ( void ) const

Follow the linked list of items to the next Element.


Starting from the supplied object, iterate over the linked list until either an Element is found or a Root object is found. If it's a Root object, return NULL. Otherwise, return the pointer to the Element object.

Returns
NULL if there are no more Element objects or a valid Element pointer
See also
GetNextItem(void) const

◆ GetNextItem()

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.

Returns
NULL if there are no more objects or a valid Generic pointer
See also
GetNextElement(void) const

◆ GetPrevious()

Generic * Burger::FileXML::Generic::GetPrevious ( void ) const
inline

Get the pointer to the previous object in the list.


Follow the linked list backward and get the item's pointer

Returns
Pointer to the previous Generic object in the list
See also
GetNext(void) const

◆ GetType()

eType Burger::FileXML::Generic::GetType ( void ) const
inline

Get the enumeration of the derived class' type.


Returns the enumeration that will identify the type of derived class from Generic this class is. If it's not derived, the value will be XML_ROOT

Returns
eType enumeration
See also
eType or Generic

◆ InsertAfter()

void Burger::FileXML::Generic::InsertAfter ( Generic * pGeneric)
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.

Parameters
pGenericPointer to the Generic object to insert in the list after this one
See also
InsertBefore(Generic *)

◆ InsertBefore()

void Burger::FileXML::Generic::InsertBefore ( Generic * pGeneric)
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.

Parameters
pGenericPointer to the Generic object to insert in the list before this one
See also
InsertAfter(Generic *)

◆ operator=() [1/2]

Generic & Burger::FileXML::Generic::operator= ( const Generic & )
privatedelete

◆ operator=() [2/2]

Generic & Burger::FileXML::Generic::operator= ( Generic && )
privatedelete

◆ Parse()

uint_t Burger::FileXML::Generic::Parse ( InputMemoryStream * pInput)
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

Parameters
pInputPointer to an input stream
Returns
Error code of zero for no error or non-zero on error

Reimplemented in Burger::FileXML::Attribute, Burger::FileXML::CData, Burger::FileXML::Comment, Burger::FileXML::Declaration, Burger::FileXML::Element, and Burger::FileXML::RawText.

◆ Save()

uint_t Burger::FileXML::Generic::Save ( OutputMemoryStream * pOutput,
uint_t uDepth ) const
virtual

Write data to a data stream.


Write the contents of this object into the XML file

Parameters
pOutputPointer to an output stream
uDepthNumber of tabs to output before saving out this record
Returns
Error code of zero for no error or non-zero on error

Reimplemented in Burger::FileXML::Attribute, Burger::FileXML::CData, Burger::FileXML::Comment, Burger::FileXML::Declaration, Burger::FileXML::Element, and Burger::FileXML::RawText.

Member Data Documentation

◆ m_eType

eType Burger::FileXML::Generic::m_eType
private

Type of derived class.

◆ m_Link

LinkedListPointer Burger::FileXML::Generic::m_Link
private

Linked list entry.