This is a utility to help perform all kinds of string related tasks. More...
Functions | |
String | CamelCaseCopy (String Source) |
Create a copy of the String that has the first letter of each word upper case and other letters lower case. More... | |
ColourValue | ConvertHexToColourValue (const String &ToConvert) |
Converts a Hex code in a string into a ColourValue. More... | |
Boole | ConvertToBool (const String &ToConvert, const Boole Default=false) |
Converts a string into a Boole. More... | |
ColourValue | ConvertToColourValue (const String &ToConvert) |
Convert four numbers in a string into a ColourValue. More... | |
String | ConvertToHexString (const ColourValue &ToConvert) |
Converts a ColourValue into a string as a Hex code. More... | |
Int16 | ConvertToInt16 (const String &ToConvert) |
Converts a string into an Int16. More... | |
Int32 | ConvertToInt32 (const String &ToConvert) |
Converts an string into an Int32. More... | |
Int8 | ConvertToInt8 (const String &ToConvert) |
Converts a string into an Int8. More... | |
Integer | ConvertToInteger (const String &ToConvert) |
Converts a string into an Integer. More... | |
Quaternion | ConvertToQuaternion (const String &ToConvert) |
Convert four numbers in a string into a Quaternion. More... | |
Real | ConvertToReal (const String &ToConvert) |
Converts a string into a Real. More... | |
template<typename T > | |
String | ConvertToString (const T &ToConvert) |
Converts any into a string. More... | |
String | ConvertToString (const Vector2 &ToConvert) |
Converts a Vector2 into a string. More... | |
String | ConvertToString (const Vector3 &ToConvert) |
Converts a Vector3 into a string. More... | |
String | ConvertToString (const Quaternion &ToConvert) |
Converts a Quaternion into a string. More... | |
String | ConvertToString (const ColourValue &ToConvert) |
Converts a ColourValue into a string. More... | |
String | ConvertToString (const Input::InputCode &Code, Boole ShiftPressed) |
Converts a Input::InputCode into a string. More... | |
UInt16 | ConvertToUInt16 (const String &ToConvert) |
Converts a string into a UInt16. More... | |
UInt32 | ConvertToUInt32 (const String &ToConvert) |
Converts a string into a UInt32. More... | |
UInt8 | ConvertToUInt8 (const String &ToConvert) |
Converts a string into a UInt8. More... | |
Vector2 | ConvertToVector2 (const String &ToConvert) |
Convert two numbers in a string into a Vector2. More... | |
Vector3 | ConvertToVector3 (const String &ToConvert) |
Convert three numbers in a string into a Vector3. More... | |
Whole | ConvertToWhole (const String &ToConvert) |
Converts a string into an Whole. More... | |
Boole | EndsWith (const String &Str, const String &Pattern, const Boole CaseSensitive) |
Checks a String to see if it ends with a specific pattern. More... | |
Boole | IsAlphaLetter (const Char8 ToCheck) |
Checks if a character is a lower or upper case letter. More... | |
Boole | IsAlphanumeric (const Char8 ToCheck) |
Checks if a character is a letter or digit. More... | |
Boole | IsDigit (const Char8 ToCheck) |
Checks if a character is a decimal digit. More... | |
Boole | IsHexDigit (const Char8 ToCheck) |
Checks if a character is a hexadecimal digit. More... | |
Boole | IsHexLetter (const Char8 ToCheck) |
Checks if a character is a hexadecimal letter. More... | |
Boole | IsLowerAlphaLetter (const Char8 ToCheck) |
Checks if a character is a lower-case alphabetic letter. More... | |
Boole | IsLowerHexLetter (const Char8 ToCheck) |
Checks if a character is a lower-case hexadecimal letter. More... | |
Boole | IsUpperAlphaLetter (const Char8 ToCheck) |
Checks if a character is a upper-case alphabetic letter. More... | |
Boole | IsUpperHexLetter (const Char8 ToCheck) |
Checks if a character is a upper-case hexadecimal letter. More... | |
String | LowerCaseCopy (String Source) |
Create a copy of the String that is lower case. More... | |
void | RemoveDuplicateWhitespaces (String &Source) |
Replaces all instances of multiple consecutive whitespaces with only a single whitespace. More... | |
StringVector | Split (const String &Source, const String &Delims=" \t\n", const Whole MaxSplits=0) |
Splits a string into multiple substrings based on the specified delimiters. More... | |
Boole | StartsWith (const String &Str, const String &Pattern, const Boole CaseSensitive) |
Checks a String to see if it starts with a specific pattern. More... | |
void | ToCamelCase (String &Source) |
Converts the first letter of each word to upper case and all other letters to lower case. More... | |
void | ToLowerCase (String &Source) |
Converts all upper case characters in a string to their respective lower case. More... | |
void | ToUpperCase (String &Source) |
Converts all lower case characters in a string to their respective upper case. More... | |
void | Trim (String &Source, Boole Left=true, Boole Right=true) |
Trims all whitespaces and tabs from a one or both sides of a String. More... | |
String | UpperCaseCopy (String Source) |
Create a copy of the String that is upper case. More... | |
Variables | |
const String | Blank = "" |
Convenience String for comparing to return blank Strings where necessary. | |
This is a utility to help perform all kinds of string related tasks.
Create a copy of the String that has the first letter of each word upper case and other letters lower case.
Source | The original String to copy. |
Definition at line 221 of file stringtool.cpp.
ColourValue Mezzanine::StringTools::ConvertHexToColourValue | ( | const String & | ToConvert | ) |
Converts a Hex code in a string into a ColourValue.
ToConvert | The string to be converted. |
Definition at line 349 of file stringtool.cpp.
Boole Mezzanine::StringTools::ConvertToBool | ( | const String & | ToConvert, |
const Boole | Default = false |
||
) |
Converts a string into a Boole.
ToConvert | The string to be converted to a Boole. |
Definition at line 379 of file stringtool.cpp.
ColourValue Mezzanine::StringTools::ConvertToColourValue | ( | const String & | ToConvert | ) |
Convert four numbers in a string into a ColourValue.
ToConvert | The string to be converted. |
Definition at line 332 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToHexString | ( | const ColourValue & | ToConvert | ) |
Converts a ColourValue into a string as a Hex code.
ToConvert | The ColourValue to be converted. |
Definition at line 366 of file stringtool.cpp.
Converts a string into an Int16.
ToConvert | The string to be converted to an Int16. |
Definition at line 432 of file stringtool.cpp.
Converts an string into an Int32.
ToConvert | The string to be converted to an Int32. |
Definition at line 448 of file stringtool.cpp.
Converts a string into an Int8.
ToConvert | The string to be converted to an Int8. |
Definition at line 416 of file stringtool.cpp.
Converts a string into an Integer.
ToConvert | The string to be converted to an Integer. |
Definition at line 400 of file stringtool.cpp.
Quaternion Mezzanine::StringTools::ConvertToQuaternion | ( | const String & | ToConvert | ) |
Convert four numbers in a string into a Quaternion.
ToConvert | The string to be converted. |
Definition at line 315 of file stringtool.cpp.
Converts a string into a Real.
ToConvert | The string to be converted to a Real. |
Definition at line 392 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const T & | ToConvert | ) |
Converts any into a string.
ToConvert | Stream class instance to be converted. |
Definition at line 257 of file stringtool.h.
Converts a Vector2 into a string.
ToConvert | The Vector2 to be converted. |
Definition at line 291 of file stringtool.cpp.
Converts a Vector3 into a string.
ToConvert | The Vector3 to be converted. |
Definition at line 308 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const Quaternion & | ToConvert | ) |
Converts a Quaternion into a string.
ToConvert | The Quaternion to be converted. |
Definition at line 325 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const ColourValue & | ToConvert | ) |
Converts a ColourValue into a string.
ToConvert | The ColourValue to be converted. |
Definition at line 342 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const Input::InputCode & | Code, |
Boole | ShiftPressed | ||
) |
Converts a Input::InputCode into a string.
Code | The input code to be converted. |
ShiftPressed | Whether or not the shift modifier key has been pressed. |
Definition at line 464 of file stringtool.cpp.
Converts a string into a UInt16.
ToConvert | The string to be converted to a UInt16. |
Definition at line 440 of file stringtool.cpp.
Converts a string into a UInt32.
ToConvert | The string to be converted to a UInt32. |
Definition at line 456 of file stringtool.cpp.
Converts a string into a UInt8.
ToConvert | The string to be converted to a UInt8. |
Definition at line 424 of file stringtool.cpp.
Convert two numbers in a string into a Vector2.
ToConvert | The string to be converted. |
Definition at line 281 of file stringtool.cpp.
Convert three numbers in a string into a Vector3.
ToConvert | The string to be converted. |
Definition at line 298 of file stringtool.cpp.
Converts a string into an Whole.
ToConvert | The string to be converted to an Whole. |
Definition at line 408 of file stringtool.cpp.
Boole Mezzanine::StringTools::EndsWith | ( | const String & | Str, |
const String & | Pattern, | ||
const Boole | CaseSensitive | ||
) |
Checks a String to see if it ends with a specific pattern.
Str | The String to check. |
Pattern | The sequence to check for at the end of the String. |
CaseSensitive | If false this function will check lower-case copies for the pattern, otherwise the strings will be checked as is. |
Definition at line 247 of file stringtool.cpp.
Checks if a character is a lower or upper case letter.
ToCheck | The character to be checked. |
Definition at line 107 of file stringtool.cpp.
Checks if a character is a letter or digit.
ToCheck | The character to be checked. |
Definition at line 122 of file stringtool.cpp.
Checks if a character is a decimal digit.
ToCheck | The character to be checked. |
Definition at line 98 of file stringtool.cpp.
Checks if a character is a hexadecimal digit.
ToCheck | The character to be checked. |
Definition at line 119 of file stringtool.cpp.
Checks if a character is a hexadecimal letter.
ToCheck | The character to be checked. |
Definition at line 116 of file stringtool.cpp.
Checks if a character is a lower-case alphabetic letter.
ToCheck | The character to be checked. |
Definition at line 101 of file stringtool.cpp.
Checks if a character is a lower-case hexadecimal letter.
ToCheck | The character to be checked. |
Definition at line 110 of file stringtool.cpp.
Checks if a character is a upper-case alphabetic letter.
ToCheck | The character to be checked. |
Definition at line 104 of file stringtool.cpp.
Checks if a character is a upper-case hexadecimal letter.
ToCheck | The character to be checked. |
Definition at line 113 of file stringtool.cpp.
Create a copy of the String that is lower case.
Source | The original String to copy. |
Definition at line 198 of file stringtool.cpp.
void Mezzanine::StringTools::RemoveDuplicateWhitespaces | ( | String & | Source | ) |
Replaces all instances of multiple consecutive whitespaces with only a single whitespace.
Source | The String to be altered. |
Definition at line 267 of file stringtool.cpp.
StringVector Mezzanine::StringTools::Split | ( | const String & | Source, |
const String & | Delims = " \t\n" , |
||
const Whole | MaxSplits = 0 |
||
) |
Splits a string into multiple substrings based on the specified delimiters.
Source | The String to be split. |
Delims | The characters to look for and use as split points in the source String. |
MaxSplits | The maximum number of splits to perform on this String. Value of zero means unlimited splits. |
Definition at line 155 of file stringtool.cpp.
Boole Mezzanine::StringTools::StartsWith | ( | const String & | Str, |
const String & | Pattern, | ||
const Boole | CaseSensitive | ||
) |
Checks a String to see if it starts with a specific pattern.
Str | The String to check. |
Pattern | The sequence to check for at the start of the String. |
CaseSensitive | If false this function will check lower-case copies for the pattern, otherwise the strings will be checked as is. |
Definition at line 227 of file stringtool.cpp.
void Mezzanine::StringTools::ToCamelCase | ( | String & | Source | ) |
Converts the first letter of each word to upper case and all other letters to lower case.
Source | The String to be converted. |
Definition at line 204 of file stringtool.cpp.
void Mezzanine::StringTools::ToLowerCase | ( | String & | Source | ) |
Converts all upper case characters in a string to their respective lower case.
Source | The String to be converted. |
Definition at line 193 of file stringtool.cpp.
void Mezzanine::StringTools::ToUpperCase | ( | String & | Source | ) |
Converts all lower case characters in a string to their respective upper case.
Source | The String to be converted. |
Definition at line 182 of file stringtool.cpp.
Trims all whitespaces and tabs from a one or both sides of a String.
Source | The original string to be trimmed. |
Left | Whether or not to trim the left side of the String. |
Right | Whether or not to trim the right side of the String. |
Definition at line 128 of file stringtool.cpp.
Create a copy of the String that is upper case.
Source | The original String to copy. |
Definition at line 187 of file stringtool.cpp.