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

Raw text object. More...

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

Public Member Functions

 RawText ()
 Create an empty raw text object.
 
 RawText (const char *pText)
 Create a raw text object with default text.
 
virtual ~RawText ()
 Call the destructor for a raw text object.
 
virtual uint_t Parse (InputMemoryStream *pInput)
 Parse raw text between XML objects.
 
virtual uint_t Save (OutputMemoryStream *pOutput, uint_t uDepth) const
 Write out a raw text object.
 
const charGetText (void) const
 Return a pointer to the contained text string.
 
void SetText (const char *pInput)
 Set a new string.
 
void SetText (const String *pInput)
 Set a new string.
 
uint_t GetBoolean (uint_t bDefault) const
 Return a boolean.
 
void SetBoolean (uint_t bValue)
 Return a boolean.
 
uint_t GetWord (uint_t uDefault, uint_t uMin=0, uint_t uMax=0xFFFFFFFFU) const
 Return an unsigned integer value.
 
void SetWord (uint_t uValue)
 Set an unsigned integer value.
 
void SetWordHex (uint_t uValue)
 Set an unsigned integer value as hex.
 
int_t GetInt (int_t iDefault, int_t iMin=(- 0x7FFFFFFF) -1, int_t iMax=0x7FFFFFFF) const
 Return a signed integer value.
 
void SetInt (int_t iValue)
 Set a signed integer value.
 
float GetFloat (float fDefault) const
 Return a floating point value.
 
float GetFloat (float fDefault, float fMin, float fMax) const
 Return a floating point value.
 
void SetFloat (float fValue)
 Set a 32 bit floating point value.
 
double GetDouble (double dDefault) const
 Return a 64 bit floating point value.
 
double GetDouble (double dDefault, double dMin, double dMax) const
 Return a 64 bit floating point value.
 
void SetDouble (double dValue)
 Set a 64 bit floating point 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.
 
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 RawTextNew (InputMemoryStream *pInput)
 Create a new RawText structure and initialize it from an input file.
 
static RawTextNew (const char *pText)
 Create a new RawText structure and initialize it.
 

Private Attributes

String m_Text
 Name of the element.
 

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

Raw text object.


In between Element markers can exist raw text, store the text in one or more of these objects.

XML Element object.
Definition burger.h:23308
Raw text object.
Definition burger.h:23280
Select a type based if the conditional is true or false.
Definition burger.h:3178
Note
This will identify with eType of XML_TEXT
See also
FileXML, FileXML::Generic, FileXML::Element or FileXML::Declaration

Constructor & Destructor Documentation

◆ RawText() [1/2]

Burger::FileXML::RawText::RawText ( )

Create an empty raw text object.


◆ RawText() [2/2]

Burger::FileXML::RawText::RawText ( const char * pText)

Create a raw text object with default text.


Parameters
pTextText to store in this newly created object

◆ ~RawText()

Burger::FileXML::RawText::~RawText ( )
virtual

Call the destructor for a raw text object.


Unlink itself from the linked list and release the contained string

Member Function Documentation

◆ GetBoolean()

BURGER_INLINE uint_t Burger::FileXML::RawText::GetBoolean ( uint_t bDefault) const
inline

Return a boolean.


Calls String::GetBoolean(uint_t) on the text and returns the result.

Parameters
bDefaultValue to return on parse failure
See also
SetBoolean(uint_t)

◆ GetDouble() [1/2]

BURGER_INLINE double Burger::FileXML::RawText::GetDouble ( double dDefault) const
inline

Return a 64 bit floating point value.


Calls String::GetDouble(double) on the text and returns the result.

Parameters
dDefaultValue to return on error
See also
SetDouble(double)

◆ GetDouble() [2/2]

BURGER_INLINE double Burger::FileXML::RawText::GetDouble ( double dDefault,
double dMin,
double dMax ) const
inline

Return a 64 bit floating point value.


Calls String::GetDouble(double,double,double) on the text and returns the result.

Parameters
dDefaultValue to return on error
dMinMinimum acceptable value
dMaxMaximum acceptable value
See also
SetDouble(double)

◆ GetFloat() [1/2]

BURGER_INLINE float Burger::FileXML::RawText::GetFloat ( float fDefault) const
inline

Return a floating point value.


Calls String::GetFloat(float) on the text and returns the result.

Parameters
fDefaultValue to return on error
See also
SetFloat(float)

◆ GetFloat() [2/2]

BURGER_INLINE float Burger::FileXML::RawText::GetFloat ( float fDefault,
float fMin,
float fMax ) const
inline

Return a floating point value.


Calls String::GetFloat(float,float,float) on the text and returns the result.

Parameters
fDefaultValue to return on error
fMinMinimum acceptable value
fMaxMaximum acceptable value
See also
SetFloat(float)

◆ GetInt()

BURGER_INLINE int_t Burger::FileXML::RawText::GetInt ( int_t iDefault,
int_t iMin = (- 0x7FFFFFFF )-1,
int_t iMax = 0x7FFFFFFF ) const
inline

Return a signed integer value.


Calls String::GetInt(int_t,int_t,int_t) on the text and returns the result.

Parameters
iDefaultValue to return on error
iMinMinimum acceptable value
iMaxMaximum acceptable value
See also
SetInt(int_t)

◆ GetText()

BURGER_INLINE const char * Burger::FileXML::RawText::GetText ( void ) const
inline

Return a pointer to the contained text string.


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

◆ GetWord()

BURGER_INLINE uint_t Burger::FileXML::RawText::GetWord ( uint_t uDefault,
uint_t uMin = 0,
uint_t uMax = 0xFFFFFFFFU ) const
inline

Return an unsigned integer value.


Calls String::GetWord(uint_t,uint_t,uint_t) on the text and returns the result.

Parameters
uDefaultValue to return on error
uMinMinimum acceptable value
uMaxMaximum acceptable value
See also
SetWord(uint_t)

◆ New() [1/2]

Burger::FileXML::RawText *BURGER_API Burger::FileXML::RawText::New ( const char * pText)
static

Create a new RawText structure and initialize it.


Copy the text string into the newly created RawText object.

Will return NULL on a parsing error or if it's out of memory

Parameters
pTextPointer to text string to initialize this object with.
Returns
NULL on error or a valid RawText record

◆ New() [2/2]

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

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


Parse the input file after whitespace and it will copy the text until a '>' or a '<' is found. Trailing whitespace will be removed.

Will return NULL on a parsing error or if it's out of memory

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

◆ Parse()

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

Parse raw text between XML objects.


Given a data string that's starting outside of an encapsulated element token, parse out the raw text until a '>' or '<' is found. Trailing whitespace is removed from the text string.

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::RawText::Save ( OutputMemoryStream * pOutput,
uint_t uDepth ) const
virtual

Write out a raw text object.


Output raw text as is. Only print leading tabs if the previously output object was not a XML_ROOT or XML_TEXT. Append a \n if the next object is not XML_ROOT or XML_TEXT.

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.

◆ SetBoolean()

BURGER_INLINE uint_t Burger::FileXML::RawText::SetBoolean ( uint_t bValue)
inline

Return a boolean.


Calls String::SetYesNo(uint_t) on the text and returns the result.

Parameters
bValueValue to pass to String::SetYesNo(uint_t)
See also
SetBoolean(uint_t)

◆ SetDouble()

BURGER_INLINE void Burger::FileXML::RawText::SetDouble ( double dValue)
inline

Set a 64 bit floating point value.


Calls String::SetDouble(double) on the text

Parameters
dValueValue to store as an integer string
See also
GetDouble(double,double,double) const

◆ SetFloat()

BURGER_INLINE void Burger::FileXML::RawText::SetFloat ( float fValue)
inline

Set a 32 bit floating point value.


Calls String::SetFloat(float) on the text

Parameters
fValueValue to store as an integer string
See also
GetFloat(float,float,float) const

◆ SetInt()

BURGER_INLINE void Burger::FileXML::RawText::SetInt ( int_t iValue)
inline

Set a signed integer value.


Calls String::SetInt(int_t) on the text

Parameters
iValueValue to store as an integer string
See also
GetInt(int_t,int_t,int_t) const

◆ SetText() [1/2]

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

Set a new string.


Replace the contained string with a new one

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

◆ SetText() [2/2]

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

Set a new string.


Replace the contained string with a new one

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

◆ SetWord()

BURGER_INLINE void Burger::FileXML::RawText::SetWord ( uint_t uValue)
inline

Set an unsigned integer value.


Calls String::SetWord(uint_t) on the text

Parameters
uValueValue to store as an unsigned integer string
See also
SetWordHex(uint_t) or GetWord(uint_t,uint_t,uint_t) const

◆ SetWordHex()

BURGER_INLINE void Burger::FileXML::RawText::SetWordHex ( uint_t uValue)
inline

Set an unsigned integer value as hex.


Calls String::SetWordHex(uint_t) on the text

Parameters
uValueValue to store as an unsigned integer hex string
See also
SetWord(uint_t) or GetWord(uint_t,uint_t,uint_t) const

Member Data Documentation

◆ m_Text

String Burger::FileXML::RawText::m_Text
private

Name of the element.