This is a utility to help perform all kinds of string related tasks. More...
Functions | |
ColourValue | ConvertHexToColourValue (const String &ToConvert) |
Converts a Hex code in a string into a ColourValue. More... | |
bool | ConvertToBool (const String &ToConvert, const bool Default=false) |
Converts a string into a bool. 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... | |
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... | |
template<typename T > | |
String | ConvertToString (const T &ToConvert) |
Converts any into a string. More... | |
String | ConvertToString (const Input::InputCode &Code, bool 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... | |
bool | EndsWith (const String &Str, const String &Pattern, const bool CaseSensitive) |
Checks a string to see if it ends with a specific pattern. More... | |
void | RemoveDuplicateWhitespaces (String &Source) |
Replaces all instances of multiple consecutive whitespaces with only a single whitespace. More... | |
CountedPtr< 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... | |
bool | StartsWith (const String &Str, const String &Pattern, const bool CaseSensitive) |
Checks a string to see if it starts with a specific pattern. 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, bool Left=true, bool Right=true) |
Trims all whitespaces and tabs from a one or both sides of a string. More... | |
Variables | |
const String | Blank = "" |
This is a utility to help perform all kinds of string related tasks.
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 276 of file stringtool.cpp.
bool Mezzanine::StringTools::ConvertToBool | ( | const String & | ToConvert, |
const bool | Default = false |
||
) |
Converts a string into a bool.
ToConvert | The string to be converted to a bool. |
Definition at line 306 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 258 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 293 of file stringtool.cpp.
Int16 Mezzanine::StringTools::ConvertToInt16 | ( | const String & | ToConvert) |
Converts a string into an Int16.
ToConvert | The string to be converted to an Int16. |
Definition at line 351 of file stringtool.cpp.
Int32 Mezzanine::StringTools::ConvertToInt32 | ( | const String & | ToConvert) |
Converts an string into an Int32.
ToConvert | The string to be converted to an Int32. |
Definition at line 367 of file stringtool.cpp.
Int8 Mezzanine::StringTools::ConvertToInt8 | ( | const String & | ToConvert) |
Converts a string into an Int8.
ToConvert | The string to be converted to an Int8. |
Definition at line 335 of file stringtool.cpp.
Integer Mezzanine::StringTools::ConvertToInteger | ( | const String & | ToConvert) |
Converts a string into an Integer.
ToConvert | The string to be converted to an Integer. |
Definition at line 327 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 240 of file stringtool.cpp.
Real Mezzanine::StringTools::ConvertToReal | ( | const String & | ToConvert) |
Converts a string into a Real.
ToConvert | The string to be converted to a Real. |
Definition at line 319 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const Vector2 & | ToConvert) |
Converts a Vector2 into a string.
ToConvert | The Vector2 to be converted. |
Definition at line 215 of file stringtool.cpp.
String Mezzanine::StringTools::ConvertToString | ( | const Vector3 & | ToConvert) |
Converts a Vector3 into a string.
ToConvert | The Vector3 to be converted. |
Definition at line 233 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 251 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 269 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 194 of file stringtool.h.
String Mezzanine::StringTools::ConvertToString | ( | const Input::InputCode & | Code, |
bool | 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 383 of file stringtool.cpp.
UInt16 Mezzanine::StringTools::ConvertToUInt16 | ( | const String & | ToConvert) |
Converts a string into a UInt16.
ToConvert | The string to be converted to a UInt16. |
Definition at line 359 of file stringtool.cpp.
UInt32 Mezzanine::StringTools::ConvertToUInt32 | ( | const String & | ToConvert) |
Converts a string into a UInt32.
ToConvert | The string to be converted to a UInt32. |
Definition at line 375 of file stringtool.cpp.
UInt8 Mezzanine::StringTools::ConvertToUInt8 | ( | const String & | ToConvert) |
Converts a string into a UInt8.
ToConvert | The string to be converted to a UInt8. |
Definition at line 343 of file stringtool.cpp.
Vector2 Mezzanine::StringTools::ConvertToVector2 | ( | const String & | ToConvert) |
Convert two numbers in a string into a Vector2.
ToConvert | The string to be converted. |
Definition at line 204 of file stringtool.cpp.
Vector3 Mezzanine::StringTools::ConvertToVector3 | ( | const String & | ToConvert) |
Convert three numbers in a string into a Vector3.
ToConvert | The string to be converted. |
Definition at line 222 of file stringtool.cpp.
bool Mezzanine::StringTools::EndsWith | ( | const String & | Str, |
const String & | Pattern, | ||
const bool | 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 169 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 190 of file stringtool.cpp.
CountedPtr< 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 105 of file stringtool.cpp.
bool Mezzanine::StringTools::StartsWith | ( | const String & | Str, |
const String & | Pattern, | ||
const bool | 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 148 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 143 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 138 of file stringtool.cpp.
void Mezzanine::StringTools::Trim | ( | String & | Source, |
bool | Left = true , |
||
bool | Right = true |
||
) |
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 96 of file stringtool.cpp.