This is a utility to help perform all kinds of string related tasks. More...
#include <stringtool.h>
Public Member Functions | |
| StringTool () | |
| Class constructor. | |
| ~StringTool () | |
| Class destructor. | |
Static Public Member Functions | |
| static bool | ConvertToBool (const String &ToConvert, const bool Default=false) |
| Converts a string into a bool. | |
| static ColourValue | ConvertToColourValue (const String &ToConvert) |
| Convert four numbers in a string into a ColourValue. | |
| static Int16 | ConvertToInt16 (const String &ToConvert) |
| Converts a string into an Int16. | |
| static Int32 | ConvertToInt32 (const String &ToConvert) |
| Converts an string into an Int32. | |
| static Int8 | ConvertToInt8 (const String &ToConvert) |
| Converts a string into an Int8. | |
| static Quaternion | ConvertToQuaternion (const String &ToConvert) |
| Convert four numbers in a string into a Quaternion. | |
| static Real | ConvertToReal (const String &ToConvert) |
| Converts a string into a Real. | |
| static String | ConvertToString (const UInt32 &ToConvert) |
| Converts a UInt32 into a string. | |
| static String | ConvertToString (const Int32 &ToConvert) |
| Converts an Int32 into a string. | |
| static String | ConvertToString (const MetaCode::InputCode &Code, bool ShiftPressed) |
| Converts a MetaCode::InputCode into a string. | |
| static String | ConvertToString (const Int16 &ToConvert) |
| Converts an Int16 into a string. | |
| static String | ConvertToString (const Vector3 &ToConvert) |
| Converts a Vector3 into a string. | |
| static String | ConvertToString (const Quaternion &ToConvert) |
| Converts a Quaternion into a string. | |
| static String | ConvertToString (const Real &ToConvert) |
| Converts an Int8 into a string. | |
| static String | ConvertToString (const Int8 &ToConvert) |
| Converts an Int8 into a string. | |
| static String | ConvertToString (const UInt8 &ToConvert) |
| Converts a UInt8 into a string. | |
| static String | ConvertToString (const Vector2 &ToConvert) |
| Converts a Vector2 into a string. | |
| static String | ConvertToString (const UInt16 &ToConvert) |
| Converts a UInt16 into a string. | |
| static String | ConvertToString (const ColourValue &ToConvert) |
| Converts a ColourValue into a string. | |
| static UInt16 | ConvertToUInt16 (const String &ToConvert) |
| Converts a string into a UInt16. | |
| static UInt32 | ConvertToUInt32 (const String &ToConvert) |
| Converts a string into a UInt32. | |
| static UInt8 | ConvertToUInt8 (const String &ToConvert) |
| Converts a string into a UInt8. | |
| static Vector2 | ConvertToVector2 (const String &ToConvert) |
| Convert two numbers in a string into a Vector2. | |
| static Vector3 | ConvertToVector3 (const String &ToConvert) |
| Convert three numbers in a string into a Vector3. | |
| static bool | EndsWith (const String &Str, const String &Pattern, const bool CaseSensitive) |
| Checks a string to see if it ends with a specific pattern. | |
| static void | RemoveDuplicateWhitespaces (String &Source) |
| Replaces all instances of multiple consecutive whitespaces with only a single whitespace. | |
| static std::vector< String > | Split (const String &Source, const String &Delims=" \t\n", const Whole &MaxSplits=0) |
| Splits a string into multiple substrings based on the specified delimiters. | |
| static bool | StartsWith (const String &Str, const String &Pattern, const bool CaseSensitive) |
| Checks a string to see if it starts with a specific pattern. | |
| static String | StringCat (const String &Front, const String &Middle1, const String &Middle2, const String &Middle3, const String &Back) |
| Concatenates 5 Strings. | |
| static String | StringCat (const String &Front, const String &Middle, const String &Back) |
| Concatenates 3 Strings. | |
| static String | StringCat (const String &Front, const String &Middle1, const String &Middle2, const String &Back) |
| Concatenates 4 Strings. | |
| static String | StringCat (const String &Front, const String &Back) |
| Concatenates 2 Strings. | |
| static String | StringCat (const String &Front, const String &Middle1, const String &Middle2, const String &Middle3, const String &Middle4, const String &Back) |
| Concatenates 6 Strings. | |
| static void | ToLowerCase (String &Source) |
| Converts all upper case characters in a string to their respective lower case. | |
| static void | ToUpperCase (String &Source) |
| Converts all lower case characters in a string to their respective upper case. | |
| static void | Trim (String &Source, bool Left=true, bool Right=true) |
| Trims all whitespaces and tabs from a one or both sides of a string. | |
This is a utility to help perform all kinds of string related tasks.
Definition at line 57 of file stringtool.h.
| bool Mezzanine::StringTool::ConvertToBool | ( | const String & | ToConvert, |
| const bool | Default = false |
||
| ) | [static] |
Converts a string into a bool.
| ToConvert | The string to be converted to a bool. |
Definition at line 254 of file stringtool.cpp.
| ColourValue Mezzanine::StringTool::ConvertToColourValue | ( | const String & | ToConvert | ) | [static] |
Convert four numbers in a string into a ColourValue.
| ToConvert | The string to be converted. |
Definition at line 231 of file stringtool.cpp.
Converts a string into an Int16.
| ToConvert | The string to be converted to an Int16. |
Definition at line 291 of file stringtool.cpp.
Converts an string into an Int32.
| ToConvert | The string to be converted to an Int32. |
Definition at line 307 of file stringtool.cpp.
Converts a string into an Int8.
| ToConvert | The string to be converted to an Int8. |
Definition at line 275 of file stringtool.cpp.
| Quaternion Mezzanine::StringTool::ConvertToQuaternion | ( | const String & | ToConvert | ) | [static] |
Convert four numbers in a string into a Quaternion.
| ToConvert | The string to be converted. |
Definition at line 211 of file stringtool.cpp.
Converts a string into a Real.
| ToConvert | The string to be converted to a Real. |
Definition at line 267 of file stringtool.cpp.
Converts a UInt32 into a string.
| ToConvert | The UInt32 to be converted. |
Definition at line 368 of file stringtool.cpp.
Converts an Int32 into a string.
| ToConvert | The Int32 to be converted. |
Definition at line 361 of file stringtool.cpp.
| String Mezzanine::StringTool::ConvertToString | ( | const MetaCode::InputCode & | Code, |
| bool | ShiftPressed | ||
| ) | [static] |
Converts a MetaCode::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 375 of file stringtool.cpp.
Converts an Int16 into a string.
| ToConvert | The Int16 to be converted. |
Definition at line 347 of file stringtool.cpp.
Converts a Vector3 into a string.
| ToConvert | The Vector3 to be converted. |
Definition at line 204 of file stringtool.cpp.
| String Mezzanine::StringTool::ConvertToString | ( | const Quaternion & | ToConvert | ) | [static] |
Converts a Quaternion into a string.
| ToConvert | The Quaternion to be converted. |
Definition at line 224 of file stringtool.cpp.
Converts an Int8 into a string.
| ToConvert | The Int8 to be converted. |
Definition at line 326 of file stringtool.cpp.
Converts an Int8 into a string.
| ToConvert | The Int8 to be converted. |
Definition at line 333 of file stringtool.cpp.
Converts a UInt8 into a string.
| ToConvert | The UInt8 to be converted. |
Definition at line 340 of file stringtool.cpp.
Converts a Vector2 into a string.
| ToConvert | The Vector2 to be converted. |
Definition at line 184 of file stringtool.cpp.
Converts a UInt16 into a string.
| ToConvert | The UInt16 to be converted. |
Definition at line 354 of file stringtool.cpp.
| String Mezzanine::StringTool::ConvertToString | ( | const ColourValue & | ToConvert | ) | [static] |
Converts a ColourValue into a string.
| ToConvert | The ColourValue to be converted. |
Definition at line 244 of file stringtool.cpp.
Converts a string into a UInt16.
| ToConvert | The string to be converted to a UInt16. |
Definition at line 299 of file stringtool.cpp.
Converts a string into a UInt32.
| ToConvert | The string to be converted to a UInt32. |
Definition at line 315 of file stringtool.cpp.
Converts a string into a UInt8.
| ToConvert | The string to be converted to a UInt8. |
Definition at line 283 of file stringtool.cpp.
Convert two numbers in a string into a Vector2.
| ToConvert | The string to be converted. |
Definition at line 171 of file stringtool.cpp.
Convert three numbers in a string into a Vector3.
| ToConvert | The string to be converted. |
Definition at line 191 of file stringtool.cpp.
| bool Mezzanine::StringTool::EndsWith | ( | const String & | Str, |
| const String & | Pattern, | ||
| const bool | CaseSensitive | ||
| ) | [static] |
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 136 of file stringtool.cpp.
| void Mezzanine::StringTool::RemoveDuplicateWhitespaces | ( | String & | Source | ) | [static] |
Replaces all instances of multiple consecutive whitespaces with only a single whitespace.
| Source | The string to be altered. |
Definition at line 157 of file stringtool.cpp.
| std::vector< String > Mezzanine::StringTool::Split | ( | const String & | Source, |
| const String & | Delims = " \t\n", |
||
| const Whole & | MaxSplits = 0 |
||
| ) | [static] |
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 72 of file stringtool.cpp.
| bool Mezzanine::StringTool::StartsWith | ( | const String & | Str, |
| const String & | Pattern, | ||
| const bool | CaseSensitive | ||
| ) | [static] |
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 115 of file stringtool.cpp.
| String Mezzanine::StringTool::StringCat | ( | const String & | Front, |
| const String & | Middle1, | ||
| const String & | Middle2, | ||
| const String & | Middle3, | ||
| const String & | Back | ||
| ) | [static] |
Concatenates 5 Strings.
| Front | The first String |
| Middle1 | The second string |
| Middle2 | The third string |
| Middle3 | The fourth string |
| Back | The last String |
Definition at line 746 of file stringtool.cpp.
| String Mezzanine::StringTool::StringCat | ( | const String & | Front, |
| const String & | Middle, | ||
| const String & | Back | ||
| ) | [static] |
Concatenates 3 Strings.
| Front | The first String |
| Middle | A String in the middle |
| Back | The last String |
Definition at line 732 of file stringtool.cpp.
| String Mezzanine::StringTool::StringCat | ( | const String & | Front, |
| const String & | Middle1, | ||
| const String & | Middle2, | ||
| const String & | Back | ||
| ) | [static] |
Concatenates 4 Strings.
| Front | The first String |
| Middle1 | The second string |
| Middle2 | The third string |
| Back | The last String |
Definition at line 739 of file stringtool.cpp.
Concatenates 2 Strings.
| Front | The first String |
| Back | The last String |
Definition at line 725 of file stringtool.cpp.
| String Mezzanine::StringTool::StringCat | ( | const String & | Front, |
| const String & | Middle1, | ||
| const String & | Middle2, | ||
| const String & | Middle3, | ||
| const String & | Middle4, | ||
| const String & | Back | ||
| ) | [static] |
Concatenates 6 Strings.
| Front | The first String |
| Middle1 | The second string |
| Middle2 | The third string |
| Middle3 | The fourth string |
| Middle4 | The fifth string |
| Back | The last String |
Definition at line 753 of file stringtool.cpp.
| void Mezzanine::StringTool::ToLowerCase | ( | String & | Source | ) | [static] |
Converts all upper case characters in a string to their respective lower case.
| Source | The string to be converted. |
Definition at line 110 of file stringtool.cpp.
| void Mezzanine::StringTool::ToUpperCase | ( | String & | Source | ) | [static] |
Converts all lower case characters in a string to their respective upper case.
| Source | The string to be converted. |
Definition at line 105 of file stringtool.cpp.
| void Mezzanine::StringTool::Trim | ( | String & | Source, |
| bool | Left = true, |
||
| bool | Right = true |
||
| ) | [static] |
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 63 of file stringtool.cpp.
1.7.3