UTF 8 bit string class. More...
Public Member Functions | |
String (void) noexcept | |
Creates an empty string. | |
String (const String &rInput) noexcept | |
Initialize a Burger::String with a Burger::String. | |
String (String &&rInput) noexcept | |
Copy constructor. | |
String & | operator= (String &&rInput) noexcept |
Copy assignment operator. | |
String (const String &rInput, uintptr_t uStart, uintptr_t uLength) noexcept | |
Initialize a Burger::String by using a subsection of a different Burger::String. | |
String (const char *pInput) noexcept | |
Initialize with a "C" string. | |
String (const char *pInput, uintptr_t uPadding) noexcept | |
Initialize with a "C" string with padding. | |
String (const uint16_t *pInput) noexcept | |
Initialize with a UTF16 string. | |
String (const uint32_t *pInput) noexcept | |
Initialize with a UTF32 string. | |
String (const char *pInput, uintptr_t uStart, uintptr_t uEnd) noexcept | |
Initialize a Burger::String by using a subsection of a different "C" string. | |
String (char iInput) noexcept | |
Initialize a Burger::String with a single character. | |
String (char iInput, uintptr_t uFillSize) noexcept | |
Initialize a Burger::String filled with a single character. | |
String (const char *pInput1, const char *pInput2) noexcept | |
Initialize a Burger::String with two concatenated "C" strings. | |
String (const char *pInput1, const char *pInput2, const char *pInput3) noexcept | |
Initialize a Burger::String with three concatenated "C" strings. | |
String (const char *pInput1, const char *pInput2, const char *pInput3, const char *pInput4) noexcept | |
Initialize a Burger::String with four concatenated "C" strings. | |
String (const char *pFmt, BURGER_SP_ARG1) noexcept | |
String (const char *pFmt, BURGER_SP_ARG2) noexcept | |
String (const char *pFmt, BURGER_SP_ARG3) noexcept | |
String (const char *pFmt, BURGER_SP_ARG4) noexcept | |
String (const char *pFmt, BURGER_SP_ARG5) noexcept | |
String (const char *pFmt, BURGER_SP_ARG6) noexcept | |
String (const char *pFmt, BURGER_SP_ARG7) noexcept | |
String (const char *pFmt, BURGER_SP_ARG8) noexcept | |
String (const char *pFmt, BURGER_SP_ARG9) noexcept | |
String (const char *pFmt, BURGER_SP_ARG10) noexcept | |
String (const char *pFmt, BURGER_SP_ARG11) noexcept | |
String (const char *pFmt, BURGER_SP_ARG12) noexcept | |
String (const char *pFmt, BURGER_SP_ARG13) noexcept | |
String (const char *pFmt, BURGER_SP_ARG14) noexcept | |
String (const char *pFmt, BURGER_SP_ARG15) noexcept | |
String (const char *pFmt, BURGER_SP_ARG16) noexcept | |
String (const char *pFmt, BURGER_SP_ARG17) noexcept | |
String (const char *pFmt, BURGER_SP_ARG18) noexcept | |
String (const char *pFmt, BURGER_SP_ARG19) noexcept | |
String (const char *pFmt, BURGER_SP_ARG20) noexcept | |
String (const char *pFmt, BURGER_SP_ARG21) noexcept | |
String (const char *pFmt, BURGER_SP_ARG22) noexcept | |
String (const char *pFmt, BURGER_SP_ARG23) noexcept | |
String (const char *pFmt, BURGER_SP_ARG24) noexcept | |
void | Printf (const char *pFmt, BURGER_SP_ARG1) noexcept |
String.Printf(const char* pFmt, .... | |
void | Printf (const char *pFmt, BURGER_SP_ARG2) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG3) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG4) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG5) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG6) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG7) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG8) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG9) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG10) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG11) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG12) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG13) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG14) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG15) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG16) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG17) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG18) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG19) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG20) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG21) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG22) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG23) noexcept |
void | Printf (const char *pFmt, BURGER_SP_ARG24) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG1) noexcept |
String.Printf(const String& pFmt, .... | |
void | Printf (const String &sFmt, BURGER_SP_ARG2) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG3) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG4) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG5) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG6) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG7) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG8) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG9) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG10) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG11) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG12) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG13) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG14) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG15) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG16) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG17) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG18) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG19) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG20) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG21) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG22) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG23) noexcept |
void | Printf (const String &sFmt, BURGER_SP_ARG24) noexcept |
~String (void) | |
Release memory, if any. | |
operator char * () noexcept | |
Return the pointer to the string. | |
operator const char * () const noexcept | |
Return the const pointer to the string. | |
const char * | c_str (void) const noexcept |
Return the const pointer to the string. | |
char * | c_str (void) noexcept |
Return the pointer to the string. | |
const char * | data (void) const noexcept |
Return the const pointer to the string. | |
char * | data (void) noexcept |
Return the pointer to the string. | |
operator char () const noexcept | |
Return the first character of the "C" string. | |
uintptr_t | length (void) const noexcept |
Return the length of the "C" string. | |
uintptr_t | size (void) const noexcept |
Return the length of the "C" string. | |
uintptr_t | capacity (void) const noexcept |
Return the size of the buffer. | |
uint_t | empty (void) const noexcept |
Return TRUE if the string is empty. | |
eError | assign (uintptr_t uLength, char iInput) noexcept |
Fill the string with a character. | |
eError | assign (const String &rInput) noexcept |
Copy a String into this string. | |
void | assign (String &&rInput) noexcept |
Move a String into this string. | |
eError | assign (const char *pInput) noexcept |
Copy a "C" string to a Burger::String. | |
eError | assign (const char *pInput, uintptr_t uLength) noexcept |
Copy an array of characters into a string. | |
eError | assign (const uint16_t *pInput) noexcept |
Copy a 16 bit "C" string to a Burger::String. | |
eError | assign (const uint16_t *pInput, uintptr_t uLength) noexcept |
Copy a 16 bit "C" string to a Burger::String. | |
eError | assign_win437 (const char *pInput) noexcept |
Copy a "C" string encoded with Win437 into the String. | |
eError | assign_win437 (const char *pInput, uintptr_t uLength) noexcept |
Copy a buffer encoded with Win437 into the String. | |
eError | assign_win1252 (const char *pInput) noexcept |
Copy a "C" string encoded with Win1252 into the String. | |
eError | assign_win1252 (const char *pInput, uintptr_t uLength) noexcept |
Copy a buffer encoded with Win1252 into the String. | |
eError | assign_mac_roman_us (const char *pInput) noexcept |
Copy a "C" string encoded with MacRomanUS into the String. | |
eError | assign_mac_roman_us (const char *pInput, uintptr_t uLength) noexcept |
Copy a buffer encoded with MacRomanUS into the String. | |
eError | resize (uintptr_t uSize) noexcept |
Force a buffer size. | |
eError | reserve (uintptr_t uNewBufferSize) noexcept |
Ensure a minimum buffer size. | |
uintptr_t | find (const String &rInput, uintptr_t uPosition=0) const noexcept |
Locate a String in a String. | |
uintptr_t | find (const char *pInput, uintptr_t uPosition=0) const noexcept |
Locate a "C" string in a String. | |
uintptr_t | find (const char *pInput, uintptr_t uPosition, uintptr_t uInputSize) const noexcept |
Locate a buffer in a String. | |
uintptr_t | find (char iInput, uintptr_t uPosition=0) const noexcept |
Locate a character in a String. | |
String & | operator= (char iInput) noexcept |
Assign a single character length string to this Burger::String. | |
String & | operator= (const char *pInput) noexcept |
Assign a "C" string to a Burger::String. | |
String & | operator= (const uint16_t *pInput) noexcept |
Assign a 16 bit "C" string to a Burger::String. | |
String & | operator= (const String &rInput) noexcept |
Assign a Burger::String. | |
String & | operator+= (char iInput) noexcept |
Append a single character to the current string. | |
String & | operator+= (const char *pInput) noexcept |
Append a UTF8 "C" string to the current string. | |
String & | operator+= (const uint16_t *pInput) noexcept |
Append a UTF16 "C" string to the current string. | |
String & | operator+= (const String &rInput) noexcept |
Append a Burger::String to the current string. | |
String | operator() (uintptr_t uStart, uintptr_t uLength) const noexcept |
Create a new Burger::String from a substring. | |
char & | operator() (uintptr_t uInput) noexcept |
Return the reference to a location in the string. | |
char const & | operator() (uintptr_t uInput) const noexcept |
Return the reference to a location in the string. | |
char & | operator[] (uintptr_t uInput) noexcept |
Return the reference to a location in the string. | |
char const & | operator[] (uintptr_t uInput) const noexcept |
Return the reference to a location in the string. | |
char | Get (uintptr_t uWhere) const noexcept |
Return a single character from the string. | |
void | Put (uintptr_t uWhere, char cInput) noexcept |
Modify a single character in the string. | |
String & | ToLowercase (void) noexcept |
Convert the string to lower case. | |
String & | ToUppercase (void) noexcept |
Convert the string to upper case. | |
String | Lowercase (void) const noexcept |
Return a lowercase copy of the string. | |
String | Uppercase (void) const noexcept |
Return an uppercase copy of the string. | |
uint_t | operator! () const noexcept |
Return TRUE if the string is empty. | |
uint_t | is_valid (void) const noexcept |
Return TRUE if the string has characters. | |
void | clear (void) noexcept |
Clear out the data. | |
uintptr_t | copy (char *pOutput, uintptr_t uOutputSize=UINTPTR_MAX) const noexcept |
Extract the string into a buffer of a specific size. | |
uintptr_t | PCopy (uint8_t *pOutput, uintptr_t uOutputSize=256) const noexcept |
Extract the string into a Pascal buffer of a specific size. | |
uintptr_t | Remove (uintptr_t uStart, uintptr_t uLength=UINTPTR_MAX) noexcept |
Remove a part of the string. | |
eError | insert (uintptr_t uStart, const char *pInput, uintptr_t uInputSize) noexcept |
Insert a string into a current String. | |
eError | push_back (char iInput) noexcept |
Append a single character to the current string. | |
char | pop_back (void) noexcept |
Remove the last character from a string. | |
eError | append (const char *pInput) noexcept |
Append a UTF8 string buffer to the current string. | |
eError | append (const uint16_t *pInput) noexcept |
Append a UTF16 string buffer to the current string. | |
eError | append (const String &rInput) noexcept |
Append a UTF8 string buffer to the current string. | |
eError | append (const char *pInput, uintptr_t uInputSize) noexcept |
Append a UTF8 string buffer to the current string. | |
String & | Left (uintptr_t uNewLength, char iInput=' ') noexcept |
Resize a string and either truncate or append with a fill character. | |
String & | Right (uintptr_t uNewLength, char iInput=' ') noexcept |
Resize a string and either truncate or prepend with a fill character. | |
uint_t | starts_with (char iInput) noexcept |
Test if the string starts with a char. | |
uint_t | starts_with (const char *pInput) noexcept |
Test if the string starts with a "C" string. | |
uint_t | starts_with (const char *pInput, uintptr_t uLength) noexcept |
Test if the string starts with a buffer of data. | |
uint_t | ends_with (char iInput) noexcept |
Test if the string ends with a char. | |
uint_t | ends_with (const char *pInput) noexcept |
Test if the string ends with a "C" string. | |
uint_t | ends_with (const char *pInput, uintptr_t uLength) noexcept |
Test if the string ends with a buffer of data. | |
int | Compare (const String &rInput) const noexcept |
Compare the string. | |
int | Compare (const char *pInput) const noexcept |
Compare the string. | |
int | Compare (char iInput) const noexcept |
Compare the string to a single character. | |
uintptr_t | RemoveChars (const char *pInput) noexcept |
Remove each and every char in the list. | |
uintptr_t | RemoveChar (char iInput) noexcept |
Remove a specific character from the string. | |
uintptr_t | NormalizeLineFeeds (void) noexcept |
Normalize Mac and PC line feeds to Linux/Unix format. | |
uint_t | GetBoolean (uint_t bDefault) const noexcept |
Convert an ASCII string into a boolean. | |
void | SetTrueFalse (uint_t bInput) noexcept |
Set the string to "true" or "false". | |
void | SetYesNo (uint_t bInput) noexcept |
Set the string to "true" or "false". | |
uint_t | GetWord (uint_t uDefault, uint_t uMin=0, uint_t uMax=0xFFFFFFFFU) const noexcept |
Return an unsigned integer value. | |
void | SetWord (uint_t uInput) noexcept |
Set an unsigned integer value. | |
void | SetWordHex (uint_t uInput) noexcept |
Set an unsigned integer value as hex. | |
int_t | GetInt (int_t iDefault, int_t iMin=(- 0x7FFFFFFF) - 1, int_t iMax=0x7FFFFFFF) const noexcept |
Return a signed integer value. | |
void | SetInt (int_t iInput) noexcept |
Set a signed integer value. | |
float | GetFloat (float fDefault) const noexcept |
Return a floating point value. | |
float | GetFloat (float fDefault, float fMin, float fMax) const noexcept |
Return a floating point value. | |
void | SetFloat (float fValue) noexcept |
Set a 32 bit floating point value. | |
double | GetDouble (double dDefault) const noexcept |
Return a 64 bit floating point value. | |
double | GetDouble (double dDefault, double dMin, double dMax) const noexcept |
Return a 64 bit floating point value. | |
void | SetDouble (double dValue) noexcept |
Set a 64 bit floating point value. | |
Static Public Attributes | |
static const uint_t | kBufferSize |
Ensures the structure is 96 bytes in size on all platforms. | |
static const uintptr_t | npos = UINTPTR_MAX |
Value returned when find() doesn't return a match. | |
Protected Member Functions | |
char * | constructor_reserve (uintptr_t uBufferSize) noexcept |
Create buffer for constructors. | |
void | assign_small (const char *pInput) noexcept |
Copy "C" string without safeguards. | |
void | assign_small (const char *pInput, uintptr_t uLength) noexcept |
Copy an array of characters to a String with shortcuts. | |
Protected Attributes | |
char * | m_pData |
Pointer to the string. | |
uintptr_t | m_uLength |
Length of the string. | |
uintptr_t | m_uBufferSize |
Size of the buffer, minimum kBufferSize. | |
char | m_Raw [kBufferSize] |
Temp preallocated buffer for most strings. | |
Private Member Functions | |
void | InitFormattedString (const char *pFormat, uintptr_t uArgCount, const ArgumentType **ppArgs) noexcept |
Static Private Member Functions | |
static uint_t | FormattedAllocCallback (uint_t bError, uintptr_t uRequestedSize, void **ppOutputBuffer, void *pContext) noexcept |
Friends | |
uint_t | operator== (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the strings are equal (Case sensitive) | |
uint_t | operator== (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the strings are equal (Case sensitive) | |
uint_t | operator== (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the strings are equal (Case sensitive) | |
uint_t | operator== (String const &rInput1, char cInput2) noexcept |
Return TRUE if the strings are equal (Case sensitive) | |
uint_t | operator== (char cInput1, String const &rInput2) noexcept |
Return TRUE if the strings are equal (Case sensitive) | |
uint_t | operator!= (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the strings are not equal (Case sensitive) | |
uint_t | operator!= (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the strings are not equal (Case sensitive) | |
uint_t | operator!= (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the strings are not equal (Case sensitive) | |
uint_t | operator!= (String const &rInput1, char cInput2) noexcept |
Return TRUE if the strings are not equal (Case sensitive) | |
uint_t | operator!= (char cInput1, String const &rInput2) noexcept |
Return TRUE if the strings are not equal (Case sensitive) | |
uint_t | operator< (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the first is less than the second (Case sensitive) | |
uint_t | operator< (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the first is less than the second (Case sensitive) | |
uint_t | operator< (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the first is less than the second (Case sensitive) | |
uint_t | operator< (String const &rInput1, char cInput2) noexcept |
Return TRUE if the first is less than the second (Case sensitive) | |
uint_t | operator< (char cInput1, String const &rInput2) noexcept |
Return TRUE if the first is less than the second (Case sensitive) | |
uint_t | operator<= (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the first is less than or equal to the second (Case sensitive) | |
uint_t | operator<= (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the first is less than or equal to the second (Case sensitive) | |
uint_t | operator<= (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the first is less than or equal to the second (Case sensitive) | |
uint_t | operator<= (String const &rInput1, char cInput2) noexcept |
Return TRUE if the first is less than or equal to the second (Case sensitive) | |
uint_t | operator<= (char cInput1, String const &rInput2) noexcept |
uint_t | operator> (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than the second (Case sensitive) | |
uint_t | operator> (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the first is greater than the second (Case sensitive) | |
uint_t | operator> (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than the second (Case sensitive) | |
uint_t | operator> (String const &rInput1, char cInput2) noexcept |
Return TRUE if the first is greater than the second (Case sensitive) | |
uint_t | operator> (char cInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than the second (Case sensitive) | |
uint_t | operator>= (String const &rInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than or equal to the second (Case sensitive) | |
uint_t | operator>= (String const &rInput1, const char *pInput2) noexcept |
Return TRUE if the first is greater than or equal to the second (Case sensitive) | |
uint_t | operator>= (const char *pInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than or equal to the second (Case sensitive) | |
uint_t | operator>= (String const &rInput1, char cInput2) noexcept |
Return TRUE if the first is greater than or equal to the second (Case sensitive) | |
uint_t | operator>= (char cInput1, String const &rInput2) noexcept |
Return TRUE if the first is greater than or equal to the second (Case sensitive) | |
UTF 8 bit string class.
This commonly used string class was designed for performance in mind. Each instance takes 64 bytes to contain data for the string and a pointer to allocated memory if the internal string buffer is too large. Since most strings rarely exceed 56 bytes in length, this class will be able to allocate and free strings with no calls to a memory manager. Only when the string exceeds the internal buffer will Burger::Alloc() and Burger::Free() be used.
Functions exist to convert UTF16 and UTF32 data into UTF8 format, which this string class uses internally for data storage.
|
inlinenoexcept |
Creates an empty string.
|
noexcept |
|
noexcept |
|
noexcept |
Initialize a Burger::String by using a subsection of a different Burger::String.
Given a starting (inclusive) and ending (exclusive) offset, grab the sub string and use it to create a new Burger::String
rInput | Burger::String to receive input from |
uStart | Offset to the first character to read from |
uLength | Number of characters to copy. |
|
noexcept |
Initialize with a "C" string.
Initialize the Burger::String with a copy of the passed string. The original string can be discarded after the call returns.
pInput | Pointer to a valid "C" string or NULL to create an empty string |
|
noexcept |
Initialize with a "C" string with padding.
Initialize the Burger::String with a copy of the passed string. The original string can be discarded after the call returns. Allocate a buffer that can hold the initialization string + the uPadding number of bytes so the programmer can manually append data to the end of the string with Burger::StringCopy() or equivalent
pInput | Pointer to a valid "C" string or NULL to create an empty string |
uPadding | Number of bytes to extend the string buffer. The extra bytes are NOT initialized |
|
noexcept |
|
noexcept |
|
noexcept |
Initialize a Burger::String by using a subsection of a different "C" string.
Copy a range of bytes from a "C" string. This will terminate early if a zero byte is found in the input stream.
pInput | A pointer to a valid "C" string |
uStart | Offset to the first character to read from |
uLength | Number of bytes to copy |
|
noexcept |
Initialize a Burger::String with a single character.
If the input character is zero, the resulting string will be empty
iInput | Character to convert to a single byte string |
|
noexcept |
Initialize a Burger::String filled with a single character.
If the input character is zero, the resulting string will be empty
iInput | Character to fill the buffer with |
uFillSize | Size, in bytes, of the resulting string |
|
noexcept |
Initialize a Burger::String with two concatenated "C" strings.
If any input string pointer is NULL, it will be treated as an empty string.
pInput1 | First string to initialize with |
pInput2 | String to append after the first |
|
noexcept |
Initialize a Burger::String with three concatenated "C" strings.
If any input string pointer is NULL, it will be treated as an empty string.
|
noexcept |
Initialize a Burger::String with four concatenated "C" strings.
If any input string pointer is NULL, it will be treated as an empty string.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Release memory, if any.
Releases any allocated memory for the string. Under most cases, this performs no operation.
|
noexcept |
Append a UTF8 string buffer to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty or nullptr , no operation is performed.
pInput | Pointer to a "C" string to append |
|
noexcept |
Append a UTF8 string buffer to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty, no operation is performed.
pInput | Pointer to a UTF8 string to append. NULL performs no operation |
uInputSize | Number of bytes to append |
|
noexcept |
|
noexcept |
Append a UTF16 string buffer to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty or nullptr , no operation is performed.
pInput | Pointer to a UTF16 "C" string to append |
|
noexcept |
Copy a "C" string to a Burger::String.
|
noexcept |
|
noexcept |
|
noexcept |
Copy a 16 bit "C" string to a Burger::String.
|
noexcept |
Copy a 16 bit "C" string to a Burger::String.
pInput | Pointer to a UTF16 "C" string. nullptr generates an empty string. |
uLength | Length of the UTF16 string in characters (sizeof(buffer)/2) |
|
noexcept |
|
noexcept |
Fill the string with a character.
Set the string size to uLength and fill the contents with iInput. The resulting string will be zero terminated.
uLength | Size in bytes of the resulting string. |
iInput | Character to fill the buffer with. |
|
noexcept |
Copy a "C" string encoded with MacRomanUS into the String.
Given a "C" string using MacRomanUS encoding, convert it to UTF8 and store it in the string.
pInput | Pointer to a "C" string encoded with MacRomanUS. nullptr generates an empty string. |
|
noexcept |
Copy a buffer encoded with MacRomanUS into the String.
Given a buffer using MacRomanUS encoding, convert it to UTF8 and store it in the string.
pInput | Pointer to a buffer encoded with MacRomanUS. |
uLength | Length of the buffer. |
|
protectednoexcept |
Copy "C" string without safeguards.
If the string is under kBufferSize -1 bytes in length AND it's not using the a buffer where a call to MemoryCopy() would fail, then call this function to copy the string since it performs some optimizations that cannot be done if either case of the input data were true.
|
protectednoexcept |
Copy an array of characters to a String with shortcuts.
If the string is under kBufferSize -1 bytes in length AND it's not using the a buffer where a call to MemoryCopy() would fail, then call this function to update the string since it performs some optimizations that cannot be done if either case of the input data were true. A zero will be appended to the final string. The input string should not contain a zero.
|
noexcept |
Copy a "C" string encoded with Win1252 into the String.
Given a "C" string using Win1252 encoding, convert it to UTF8 and store it in the string.
|
noexcept |
Copy a buffer encoded with Win1252 into the String.
Given a buffer using Win1252 encoding, convert it to UTF8 and store it in the string.
pInput | Pointer to a buffer encoded with Win1252. |
uLength | Length of the buffer. |
|
noexcept |
Copy a "C" string encoded with Win437 into the String.
Given a "C" string using Win437 encoding, convert it to UTF8 and store it in the string.
|
noexcept |
Copy a buffer encoded with Win437 into the String.
Given a buffer using Win437 encoding, convert it to UTF8 and store it in the string.
pInput | Pointer to a buffer encoded with Win437. |
uLength | Length of the buffer. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Return the size of the buffer.
|
noexcept |
Clear out the data.
Set the string to an empty string
|
noexcept |
Compare the string to a single character.
Compare two strings for equality using the rules found in the ANSI function strcmp(). This is a functional equivalent
iInput | Character to convert to a string of a single character in length. Zero will perform as if an empty string was passed in. |
|
noexcept |
Compare the string.
Compare two strings for equality using the rules found in the ANSI function strcmp(). This is a functional equivalent
pInput | Pointer to a "C" string to compare against. nullptr will perform as if an empty string was passed in. |
|
inlinenoexcept |
Compare the string.
Compare two strings for equality using the rules found in the ANSI function strcmp(). This is a functional equivalent
rInput | Reference to a Burger::String to compare against. |
|
protectednoexcept |
Create buffer for constructors.
This is a private function for constructors only. It will set up an initial buffer for storing a string requested by a constructor. If the allocation fails, the function will return nullptr.
|
noexcept |
Extract the string into a buffer of a specific size.
This will truncate the string if the buffer is too small
pOutput | Pointer to a buffer to receive the "C" string |
uOutputSize | Size in bytes of the output buffer |
|
inlinenoexcept |
Return the const pointer to the string.
Helper to access the const pointer to the UTF8 ASCII string
|
inlinenoexcept |
Return the pointer to the string.
Helper to access the pointer to the UTF8 ASCII string
|
inlinenoexcept |
|
noexcept |
Test if the string ends with a char.
If the string is not empty, test the last character for a match and return TRUE if so. Always return FALSE if the string is empty.
iInput | Character to match |
|
noexcept |
Test if the string ends with a "C" string.
If the string is not empty, test the input "C" string for a match and return TRUE if so. Always return FALSE if the string is empty. If the input string is empty, always return FALSE.
|
noexcept |
Test if the string ends with a buffer of data.
If the string is not empty, test the input buffer for a match and return TRUE if so. Always return FALSE if the string is empty. If the input buffer is empty, always return FALSE.
pInput | Text buffer to match. |
uLength | Length of the text buffer. Zero will always return FALSE |
|
noexcept |
Locate a character in a String.
Starting from uPosition (Default = 0), scan the string for a character and return the offset into the string where the first match was found. Return npos if there was no match.
iInput | Single ASCII character to match in the string. |
uPosition | Offset in elements of the string to begin the match. |
|
noexcept |
Locate a buffer in a String.
Starting from uPosition (Default = 0), scan the string for a match to a buffer and return the offset into this string where the first match was found. Return npos if there was no match.
pInput | Pointer to the buffer to match. |
uPosition | Offset in elements of this string to begin the match. |
uInputSize | Length of the buffer in elements. |
|
noexcept |
Locate a "C" string in a String.
Starting from uPosition (Default = 0), scan the string for a match to a "C" string and return the offset into this string where the first match was found. Return npos if there was no match.
pInput | Pointer to "C" string to match. |
uPosition | Offset in elements of this string to begin the match. |
|
noexcept |
Starting from uPosition (Default = 0), scan this string for a match to a supplied String and return the offset into this String where the first match was found. Return npos if there was no match.
rInput | Reference to a String to match. |
uPosition | Offset in elements of the string that began the match. |
|
staticprivatenoexcept |
|
noexcept |
Return a single character from the string.
If the index is beyond the end if the string, the function will return a zero.
uWhere | Index to fetch a character from |
Convert an ASCII string into a boolean.
Convert the string to a TRUE or a FALSE. If the input is nullptr or invalid, return the default value.
"true" and "yes" are considered TRUE while "false" and "no" are considered FALSE. The comparison is case insensitive.
bDefault | Default boolean to return in the event of a parsing error. |
|
inlinenoexcept |
Return a 64 bit floating point value.
Scan the value string as a 64 bit floating point numeric value and if successful, return it. If it's not a number, return the default.
If NaN or Inf is detected, it will be converted to a zero to prevent floating point issues.
dDefault | Value to return on error |
|
inlinenoexcept |
Return a 64 bit floating point value.
Scan the value string as a 64 bit floating point numeric value and if successful, test it against the valid range and return the value clamped to that range. If it's not a number, return the default.
If NaN or Inf is detected, it will be converted to a zero to prevent floating point issues.
dDefault | Value to return on error |
dMin | Minimum acceptable value |
dMax | Maximum acceptable value |
|
inlinenoexcept |
Return a floating point value.
Scan the value string as a 32 bit floating point numeric value and if successful, return it. If it's not a number, return the default.
If NaN or Inf is detected, it will be converted to a zero to prevent floating point issues.
fDefault | Value to return on error |
|
inlinenoexcept |
Return a floating point value.
Scan the value string as a 32 bit floating point numeric value and if successful, test it against the valid range and return the value clamped to that range. If it's not a number, return the default.
If NaN or Inf is detected, it will be converted to a zero to prevent floating point issues.
fDefault | Value to return on error |
fMin | Minimum acceptable value |
fMax | Maximum acceptable value |
|
inlinenoexcept |
Return a signed integer value.
Scan the value string as a 32 bit signed integer or hex value and if successful, test it against the valid range and return the value clamped to that range. If it's not a number, return the default.
Hex strings are acceptable input in the form of $1234 and 0x1234. 0xFFFFFFFF will be converted to -1.
iDefault | Value to return on error |
iMin | Minimum acceptable value |
iMax | Maximum acceptable value |
|
inlinenoexcept |
Return an unsigned integer value.
Scan the value string as a 32 bit unsigned integer or hex value and if successful, test it against the valid range and return the value clamped to that range. If it's not a number, return the default.
Hex strings are acceptable input in the form of $1234 and 0x1234
uDefault | Value to return on error |
uMin | Minimum acceptable value |
uMax | Maximum acceptable value |
|
privatenoexcept |
|
noexcept |
Insert a string into a current String.
If uStart is beyond the end of the string, it's placed at the end of the string.
If Text points to a "C" string that is smaller than MaxLen, then only the length of the "C" string is used
uStart | Index to insert the new characters |
pInput | Pointer to the string to insert |
uLength | Number of bytes to insert |
|
inlinenoexcept |
|
noexcept |
Resize a string and either truncate or append with a fill character.
Force the string to be a specific size. If the string grows, fill in the extra space with the pad character. Retain the preexisting string from index zero to index uNewLength
uNewLength | Number of bytes the string will occupy |
iInput | character to fill the buffer with in case of growth |
|
inlinenoexcept |
|
inlinenoexcept |
Return a lowercase copy of the string.
Make a copy of the string with all of the ASCII uppercase characters converted to lowercase.
|
noexcept |
Normalize Mac and PC line feeds to Linux/Unix format.
Find all occurrences of '\r' and '\r\n' and replace them with a single '\n' character. The string will be reduced in size if necessary.
|
inlinenoexcept |
Return the first character of the "C" string.
Helper to access the first character of the "C" string. It can be zero.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Return the reference to a location in the string.
Given an offset into the string, return the reference to the character. If the offset exceeds the length of the string, it will be clamped to the terminating zero.
uInput | Offset to the starting character of the new string |
|
inlinenoexcept |
Return the reference to a location in the string.
Given an offset into the string, return the reference to the character. If the offset exceeds the length of the string, it will be clamped to the terminating zero.
uInput | Offset to the starting character of the new string |
|
inlinenoexcept |
Create a new Burger::String from a substring.
Given the start and end offsets of a string, create a new string with those offsets and return the resulting string
uStart | Offset to the starting character of the new string |
uLength | Number of characters to copy |
|
noexcept |
Append a single character to the current string.
Increase the buffer if needed and append the input character to the existing string. If the input character is zero, no operation is performed.
iInput | Character to append, zero does nothing. |
|
noexcept |
Append a UTF8 "C" string to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty, no operation is performed.
|
noexcept |
Append a Burger::String to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty, no operation is performed.
rInput | Reference to string to append |
|
noexcept |
Append a UTF16 "C" string to the current string.
Increase the buffer if needed and append the input string to the existing string. If the input string is empty, no operation is performed.
|
noexcept |
Assign a single character length string to this Burger::String.
If the input is zero, the string is empty.
iInput | Single low ASCII character to create a string. |
|
noexcept |
Assign a "C" string to a Burger::String.
Copy the contents of a UTF8 "C" string into this Burger::String
|
noexcept |
Assign a Burger::String.
Copy the contents of a Burger::String into this Burger::String
rInput | Reference to a Burger::String to copy from |
|
noexcept |
Assign a 16 bit "C" string to a Burger::String.
Copy the contents of a UTF16 "C" string into this Burger::String
|
noexcept |
Copy assignment operator.
Only available on C++11 or higher.
rInput | Reference to a Burger::String |
|
inlinenoexcept |
Return the reference to a location in the string.
Given an offset into the string, return the reference to the character. If the offset exceeds the length of the string, it will be clamped to the terminating zero.
uInput | Offset to the starting character of the new string |
|
inlinenoexcept |
Return the reference to a location in the string.
Given an offset into the string, return the reference to the character. If the offset exceeds the length of the string, it will be clamped to the terminating zero.
uInput | Offset to the starting character of the new string |
|
noexcept |
Extract the string into a Pascal buffer of a specific size.
This will truncate the string if the buffer is too small
pOutput | Buffer of up a maximum of 256 bytes in length |
uOutputSize | Size of the buffer in bytes. If the value is greater than 256 it will be truncated to 256. |
|
noexcept |
Remove the last character from a string.
If there is data, remove the last entry, update the length and then return the removed character. If the string is empty, zero is returned and no other action is performed.
|
inlinenoexcept |
String.Printf(const char* pFmt, ....
)
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
String.Printf(const String& pFmt, ....
)
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Append a single character to the current string.
Increase the buffer if needed and append the input character to the existing string. If the input character is zero, no operation is performed.
iInput | Character to append, zero does nothing. |
|
noexcept |
Modify a single character in the string.
uWhere | Offset into the string to write to. |
cInput | Character to update the string with. |
|
noexcept |
Remove a part of the string.
This routine will not resize the buffer
uStart | Starting index into the string for the section to remove |
uLength | Number of bytes to remove from the string |
|
noexcept |
Remove a specific character from the string.
Find all occurrences of the character and remove them. The string will be reduced in size if necessary.
iInput | Character to remove from the string. Zero will perform no action |
|
noexcept |
Remove each and every char in the list.
Given a string containing characters, remove the characters found from the current string. Duplicating characters in the input string will reduce performance slightly. The order of the characters is not important.
pInput | Pointer to a "C" string containing the characters to remove. nullptr performs no action |
|
noexcept |
Ensure a minimum buffer size.
Set the buffer to at least a specific size while retaining the existing string. If the preexisting buffer is not large enough, it will be grown to accomodate the new buffer. The buffer size will be padded to reserve one byte for the terminating zero.
If the buffer is already large enough to satisfy this request, no operation will be performed.
uNewBufferSize | Number of bytes to set the buffer to |
|
noexcept |
Force a buffer size.
Set the buffer to a specific size while retaining the existing string. If the preexisting string is too long for the new buffer, it will be truncated. The buffer size will be padded to reserve one byte for the terminating zero.
uSize | Number of bytes to set the buffer to |
|
noexcept |
Resize a string and either truncate or prepend with a fill character.
Force the string to be a specific size. If the string grows, fill in the extra space with the pad character. Note: I am padding the string from the "left" side. I.E. the string is moved to the right.
uNewLength | Number of bytes the string will occupy |
iInput | character to fill the buffer with in case of growth |
|
noexcept |
Set a 64 bit floating point value.
Convert the input into an floating point representation of a UTF-8 string and set the value to this string
dValue | Value to store as a 64 bit floating point string |
|
noexcept |
Set a 32 bit floating point value.
Convert the input into an floating point representation of a UTF-8 string and set the value to this string
fValue | Value to store as a floating point string |
|
noexcept |
Set a signed integer value.
Convert the input into an signed integer UTF-8 string and set the value to this string
iInput | Value to store as a signed integer string |
|
noexcept |
Set the string to "true" or "false".
If the input value is zero, set the string to "false", otherwise set the string to "true".
bInput | Value to store as a string |
|
noexcept |
Set an unsigned integer value.
Convert the input into an unsigned integer UTF-8 string and set the value to this string
uInput | Value to store as an unsigned integer string |
|
noexcept |
Set an unsigned integer value as hex.
Convert the input into a "C" style hex string in the format of 0x12345678 and store this string as the value
uValue | Value to store as an unsigned integer hex string |
|
noexcept |
Set the string to "true" or "false".
If the input value is zero, set the string to "false", otherwise set the string to "true".
bInput | Value to store as a string |
|
inlinenoexcept |
|
noexcept |
Test if the string starts with a char.
If the string is not empty, test the first character for a match and return TRUE if so. Always return FALSE if the string is empty.
iInput | Character to match |
|
noexcept |
Test if the string starts with a "C" string.
If the string is not empty, test the input "C" string for a match and return TRUE if so. Always return FALSE if the string is empty. If the input string is empty, always return FALSE.
|
noexcept |
Test if the string starts with a buffer of data.
If the string is not empty, test the input buffer for a match and return TRUE if so. Always return FALSE if the string is empty. If the input buffer is empty, always return FALSE.
pInput | Text buffer to match. |
uLength | Length of the text buffer. Zero will always return FALSE |
|
inlinenoexcept |
Convert the string to lower case.
Convert all ASCII uppercase characters to lowercase.
|
inlinenoexcept |
Convert the string to upper case.
Convert all ASCII lowercase characters to uppercase.
|
inlinenoexcept |
Return an uppercase copy of the string.
Make a copy of the string with all of the ASCII lowercase characters converted to uppercase.
|
friend |
Return TRUE if the strings are not equal (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the strings are not equal (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the strings are not equal (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the strings are not equal (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the strings are not equal (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than the second (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than the second (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than the second (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the first is less than the second (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the first is less than the second (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than or equal to the second (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than or equal to the second (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is less than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the first is less than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the first is less than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the strings are equal (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the strings are equal (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the strings are equal (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the strings are equal (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the strings are equal (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than the second (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than the second (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than the second (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the first is greater than the second (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the first is greater than the second (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than or equal to the second (Case sensitive)
cInput1 | Single character as a string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than or equal to the second (Case sensitive)
pInput1 | Pointer to "C" string to test |
rInput2 | Burger::String to test against |
|
friend |
Return TRUE if the first is greater than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
cInput2 | Single character as a string to test against |
|
friend |
Return TRUE if the first is greater than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
pInput2 | Pointer to "C" string to test against |
|
friend |
Return TRUE if the first is greater than or equal to the second (Case sensitive)
rInput1 | Burger::String to test |
rInput2 | Burger::String to test against |
|
static |
|
protected |
Pointer to the string.
|
protected |
Temp preallocated buffer for most strings.
|
protected |
Size of the buffer, minimum kBufferSize.
|
protected |
Length of the string.
|
static |
Value returned when find() doesn't return a match.