![]() |
Angel
A 2D Game Prototyping Engine
|
#include "../Infrastructure/Common.h"#include "../Infrastructure/Vector2.h"#include <set>Go to the source code of this file.
Typedefs | |
| typedef std::string | String |
| typedef std::vector< String > | StringList |
| typedef std::set< String > | StringSet |
Functions | |
| int | StringToInt (const String &s) |
| float | StringToFloat (const String &s) |
| bool | StringToBool (const String &s) |
| Vector2 | StringToVector2 (const String &s) |
| String | IntToString (int val) |
| String | FloatToString (float val) |
| String | BoolToString (bool val) |
| String | Vector2ToString (const Vector2 &val) |
| String | ToUpper (const String &s) |
| String | ToLower (const String &s) |
| StringList | SplitString (const String &splitMe, const String &splitChars, bool bRemoveEmptyEntries=true) |
| StringList | SplitString (const String &splitMe) |
| String | TrimString (const String &trimMe, const String &trimChars) |
| String | TrimString (const String &trimMe) |
A set of C-style utility functions for manipulating strings.
Definition in file StringUtil.h.
| int StringToInt | ( | const String & | s | ) |
Convert a string to an integer.
| s | The string to convert |
Definition at line 65 of file StringUtil.cpp.
| float StringToFloat | ( | const String & | s | ) |
Convert a string to a float.
| s | The string to convert |
Definition at line 72 of file StringUtil.cpp.
| bool StringToBool | ( | const String & | s | ) |
Convert a string to a bool. First looks to see if the string is "true" or "false" with any capitalization. If not, then it tries to convert it to an integer and uses that as the result (0 being false; any other value being true).
| s | The string to convert |
Definition at line 79 of file StringUtil.cpp.
| Vector2 StringToVector2 | ( | const String & | s | ) |
Converts a string of two numbers separated by a whitespace character to a Vector2. Returns a zero-length vector if the string is invalid. (0, 0)
| s | The string to convert |
Definition at line 89 of file StringUtil.cpp.
| String IntToString | ( | int | val | ) |
Converts an integer to a string.
| val | The integer to convert |
Definition at line 104 of file StringUtil.cpp.
| String FloatToString | ( | float | val | ) |
Converts a float to a string.
| val | The float to convert |
Definition at line 109 of file StringUtil.cpp.
| String BoolToString | ( | bool | val | ) |
Converts a bool to a string.
| val | The bool to convert |
Definition at line 114 of file StringUtil.cpp.
| String Vector2ToString | ( | const Vector2 & | val | ) |
Converts a Vector2 to a string.
| val | The Vector2 to convert |
Definition at line 119 of file StringUtil.cpp.
| String ToUpper | ( | const String & | s | ) |
Converts a string to all uppercase
| s | The string to convert |
Definition at line 125 of file StringUtil.cpp.
| String ToLower | ( | const String & | s | ) |
Converts a string to all lowercase
| s | The string to convert |
Definition at line 135 of file StringUtil.cpp.
| StringList SplitString | ( | const String & | splitMe, |
| const String & | splitChars, | ||
| bool | bRemoveEmptyEntries = true |
||
| ) |
Splits a long string into a StringList.
| splitMe | The string to split up |
| splitChars | The set of delimiter characters to use for the splitting |
| bRemoveEmptyEntries | Whether or not empty strings (resulting from multiple delimiters) should be added to the return list |
Definition at line 146 of file StringUtil.cpp.
| StringList SplitString | ( | const String & | splitMe | ) |
Splits a long string into a StringList wherever newlines or tabs appear.
| splitMe | The string to split |
Definition at line 175 of file StringUtil.cpp.
| String TrimString | ( | const String & | trimMe, |
| const String & | trimChars | ||
| ) |
Remove a series of duplicated characters from a string.
| trimMe | The string to trim |
| trimChars | The characters to remove |
Definition at line 181 of file StringUtil.cpp.
| String TrimString | ( | const String & | trimMe | ) |
Remove whitespace from the beginning or end of a string
| trimMe | The string to trim |
Definition at line 216 of file StringUtil.cpp.


1.7.5.1