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::CData Class Reference

Untouched text object intended for application parsing. More...

Inheritance diagram for Burger::FileXML::CData:
Collaboration diagram for Burger::FileXML::CData:

Public Member Functions

 CData ()
 Create an empty CDATA object.
 
 CData (const char *pCData)
 Create a CDATA object with text.
 
virtual ~CData ()
 Call the destructor for a CDATA object.
 
virtual uint_t Parse (InputMemoryStream *pInput)
 Parse an XML CDATA object.
 
virtual uint_t Save (OutputMemoryStream *pOutput, uint_t uDepth) const
 Write out an XML CDATA object.
 
const char * GetText (void) const
 Return a pointer to the contained CDATA string.
 
void SetText (const char *pInput)
 Set a new CDATA string.
 
void SetText (const String *pInput)
 Set a new CDATA string.
 
- Public Member Functions inherited from Burger::FileXML::Generic
 Generic (eType uType)
 Initialize a generic object.
 
virtual ~Generic ()
 Call the destructor for a generic object.
 
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.
 

Static Public Member Functions

static CDataNew (InputMemoryStream *pInput)
 Create a new CDATA structure and initialize it from an input file.
 
static CDataNew (const char *pCData)
 Create a new CDATA structure and initialize it with a string.
 

Private Attributes

String m_CData
 Unmodified text for a CData line.
 

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.
 

Detailed Description

Untouched text object intended for application parsing.


For every record in an XML file, store the text in one of these objects. It will not be translated and is retained so when the file is saved, the comments will be intact.

Note
This will identify with eType of XML_CDATA
See also
FileXML, FileXML::Generic, FileXML::Element or FileXML::Comment

Constructor & Destructor Documentation

◆ CData() [1/2]

Burger::FileXML::CData::CData ( )

Create an empty CDATA object.


◆ CData() [2/2]

Burger::FileXML::CData::CData ( const char * pCData)

Create a CDATA object with text.


Parameters
pCDataText to store in this newly created object

◆ ~CData()

Burger::FileXML::CData::~CData ( )
virtual

Call the destructor for a CDATA object.


Unlink itself from the linked list and release the contained string

Member Function Documentation

◆ GetText()

const char * Burger::FileXML::CData::GetText ( void ) const
inline

Return a pointer to the contained CDATA string.


See also
SetText(const char *) or SetText(const String *)

◆ New() [1/2]

Burger::FileXML::CData *BURGER_API Burger::FileXML::CData::New ( const char * pCData)
static

Create a new CDATA structure and initialize it with a string.


Will return NULL if it's out of memory

Parameters
pCDataText to store in this newly created object
Returns
NULL on error or a valid CData record

◆ New() [2/2]

Burger::FileXML::CData *BURGER_API Burger::FileXML::CData::New ( InputMemoryStream * pInput)
static

Create a new CDATA structure and initialize it from an input file.


Parse the input file after the starting and up to and including the ending Will return NULL on a parsing error or if it's out of memory

Parameters
pInputPointer to an input stream at the byte after the
Returns
NULL on error or a valid CData record on a successful parse

◆ Parse()

uint_t Burger::FileXML::CData::Parse ( InputMemoryStream * pInput)
virtual

Parse an XML CDATA object.


Given a data string that's starting right after the initial in an XML file, parse out the data and remove the trailing . Return an error if a ]]> was not found before the data stream was exhausted.

Parameters
pInputPointer to the input text stream
Returns
Zero if no error, non-zero on error
See also
Save(OutputMemoryStream *)

Reimplemented from Burger::FileXML::Generic.

◆ Save()

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

Write out an XML CDATA object.


Encapsulate a CDATA record with \n and send it out the data stream

Parameters
pOutputPointer to the output text stream
uDepthNumber of tabs to output for formatting before writing out the CDATA
Returns
Zero if no error, non-zero on error
See also
Parse(InputMemoryStream *)

Reimplemented from Burger::FileXML::Generic.

◆ SetText() [1/2]

void Burger::FileXML::CData::SetText ( const char * pInput)
inline

Set a new CDATA string.


Replace the contained CDATA string with a new one

Parameters
pInputPointer to a "C" string
See also
GetText(void) const or SetText(const String *)

◆ SetText() [2/2]

void Burger::FileXML::CData::SetText ( const String * pInput)
inline

Set a new CDATA string.


Replace the contained CDATA string with a new one

Parameters
pInputPointer to a String class instance
See also
GetText(void) const or SetText(const char *)

Member Data Documentation

◆ m_CData

String Burger::FileXML::CData::m_CData
private

Unmodified text for a CData line.