Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Burger::FileXML::Comment Class Reference

Comment text object. More...

Inheritance diagram for Burger::FileXML::Comment:
Inheritance graph
[legend]
Collaboration diagram for Burger::FileXML::Comment:
Collaboration graph
[legend]

Public Member Functions

 Comment ()
 Create an empty comment object.
 
 Comment (const char *pComment)
 Create a comment object with text.
 
virtual ~Comment ()
 Call the destructor for a Comment object.
 
virtual uint_t Parse (InputMemoryStream *pInput)
 Parse an XML comment object.
 
virtual uint_t Save (OutputMemoryStream *pOutput, uint_t uDepth) const
 Write out an XML comment object.
 
const charGetText (void) const
 Return a pointer to the contained comment string.
 
void SetText (const char *pInput)
 Set a new comment string.
 
void SetText (const String *pInput)
 Set a new comment 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 charget_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 CommentNew (InputMemoryStream *pInput)
 Create a new Comment structure and initialize it from an input file.
 
static CommentNew (const char *pComment)
 Create a new Comment structure and initialize it with a string.
 

Private Attributes

String m_Comment
 Unmodified text for a comment 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

Comment text object.


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 text can contain "illegal" characters like \n and '&'
This will identify with eType of XML_COMMENT
See also
Burger::FileXML, Burger::FileXML::Generic, Burger::FileXML::Element or Burger::FileXML::Declaration

Constructor & Destructor Documentation

◆ Comment() [1/2]

Burger::FileXML::Comment::Comment ( )

Create an empty comment object.


◆ Comment() [2/2]

Burger::FileXML::Comment::Comment ( const char * pComment)

Create a comment object with text.


Parameters
pCommentText to store in this newly created object

◆ ~Comment()

Burger::FileXML::Comment::~Comment ( )
virtual

Call the destructor for a Comment object.


Unlink itself from the linked list and release the contained string

Member Function Documentation

◆ GetText()

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

Return a pointer to the contained comment string.


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

◆ New() [1/2]

Burger::FileXML::Comment *BURGER_API Burger::FileXML::Comment::New ( const char * pComment)
static

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


Will return NULL on if it's out of memory.

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

◆ New() [2/2]

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

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


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

Note
No translation is done to the text at all. It's likely it can contain illegal characters like line feeds and ampersands.
Parameters
pInputPointer to an input stream at the byte after the

◆ Parse()

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

Parse an XML comment object.


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

Note
No translation is done to the text at all. It's likely it can contain illegal characters like line feeds and ampersands.
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::Comment::Save ( OutputMemoryStream * pOutput,
uint_t uDepth ) const
virtual

Write out an XML comment object.


Encapsulate a comment 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 comment
Returns
Zero if no error, non-zero on error
See also
Parse(InputMemoryStream *)

Reimplemented from Burger::FileXML::Generic.

◆ SetText() [1/2]

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

Set a new comment string.


Replace the contained comment 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::Comment::SetText ( const String * pInput)
inline

Set a new comment string.


Replace the contained comment 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_Comment

String Burger::FileXML::Comment::m_Comment
private

Unmodified text for a comment line.