XML Declaration object. More...
Public Member Functions | |
Declaration () | |
Create an empty declaration object. | |
Declaration (float fVersion, const char *pEncoding=0, uint_t bStandalone=2) | |
Create a declaration object with supplied defaults. | |
virtual | ~Declaration () |
Call the destructor for a Declaration object. | |
virtual uint_t | Parse (InputMemoryStream *pInput) |
Parse an XML Declaration object. | |
virtual uint_t | Save (OutputMemoryStream *pOutput, uint_t uDepth) const |
Write out an XML Declaration object. | |
float | GetVersion (void) const |
Return the declaration version. | |
void | SetVersion (float fInput=1.0f) |
Sets the declaration version. | |
const char * | GetEncoding (void) const |
Return the declaration encoding string. | |
void | SetEncoding (const char *pInput) |
Sets the declaration encoding. | |
void | SetEncoding (const String *pInput) |
Sets the declaration encoding. | |
uint_t | GetStandalone (void) const |
Return the standalone boolean. | |
void | SetStandalone (uint_t bInput) |
Sets the declaration standalone value. | |
Public Member Functions inherited from Burger::FileXML::Generic | |
Generic (eType uType) | |
Initialize a generic object. | |
virtual | ~Generic () |
Call the destructor for a generic object. | |
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. | |
Static Public Member Functions | |
static Declaration * | New (InputMemoryStream *pInput) |
Create a new Declaration structure and initialize it from an input file. | |
static Declaration * | New (float fVersion, const char *pEncoding=0, uint_t bStandalone=2) |
Create a new Declaration structure and initialize it. | |
Private Attributes | |
String | m_Encoding |
ASCII of the encoding (Normally it's UTF-8) | |
float | m_fVersion |
Version number of the declaration. | |
uint_t | m_bStandalone |
TRUE if it's a standalone XML file | |
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. | |
XML Declaration object.
Sometimes an XML file has a <?xml ?> record for declaring the text encoding. This object contains this information. XML files should only have one of these records at the start of the file. It's not good practice to have multiple records nor having it not be the first record in the file.
Burger::FileXML::Declaration::Declaration | ( | ) |
Create an empty declaration object.
Burger::FileXML::Declaration::Declaration | ( | float | fVersion, |
const char * | pEncoding = 0, | ||
uint_t | bStandalone = 2 ) |
Create a declaration object with supplied defaults.
|
virtual |
Call the destructor for a Declaration object.
Unlink itself from the linked list and release the contained strings
|
inline |
Return the declaration encoding string.
Usually it's UTF-8 or ISO-8859-1
|
inline |
|
inline |
|
static |
Create a new Declaration structure and initialize it.
Parse the input file after the starting <?xml and up to and including the ending ?> Will return NULL on a parsing error or if it's out of memory
fVersion | Version number of the declaration |
pEncoding | Pointer to the string containing the encoding or an empty string. |
bStandalone | TRUE for standalone, FALSE for not standalone, 2 for not standalone and disable the entry on write |
|
static |
Create a new Declaration structure and initialize it from an input file.
Parse the input file after the starting <?xml and up to and including the ending ?> Will return NULL on a parsing error or if it's out of memory
pInput | Pointer to an input stream at the byte after the <?xml |
|
virtual |
Parse an XML Declaration object.
pInput | Pointer to the input text stream |
Reimplemented from Burger::FileXML::Generic.
|
virtual |
Write out an XML Declaration object.
pOutput | Pointer to the output text stream |
uDepth | Number of tabs to output for formatting before writing out the comment |
Reimplemented from Burger::FileXML::Generic.
|
inline |
Sets the declaration encoding.
Replace the contained encoding value string with a new one
pInput | Pointer to the string containing the encoding or an empty string. |
|
inline |
Sets the declaration encoding.
Replace the contained encoding value string with a new one
pInput | Pointer to the string containing the encoding or an empty string. |
|
inline |
Sets the declaration standalone value.
There's a special value of 2 that will set the standalone value to "false" and disable the ability to save this attribute to the output file.
bInput | TRUE for standalone, FALSE for not standalone, 2 for not standalone and disable the entry on write |
void BURGER_API Burger::FileXML::Declaration::SetVersion | ( | float | fInput = 1.0f | ) |
Sets the declaration version.
fInput | Version number of the declaration |
|
private |
ASCII of the encoding (Normally it's UTF-8)
|
private |
Version number of the declaration.