![]() |
Blamite Game Engine - Strings
00326.06.27.21.0407.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
Namespace containing functions to convert between various types of variables. More...
Functions | |
STRINGS_API std::wstring | ConvertStringToWstring (std::string string) |
Converts a String to a Wide String. More... | |
STRINGS_API std::string | WstringToString (std::wstring wide_string) |
Converts a Wide String to a String. More... | |
STRINGS_API bool | StringToBool (std::string string) |
Converts a string to a boolean. More... | |
STRINGS_API bool | HexStringToChar (std::string hex, char *character) |
Converts a hexadecimal code to its respective character. More... | |
STRINGS_API float | StringToFloat (std::string string) |
Converts a string representation of a float to a float . More... | |
STRINGS_API int | StringToInt (std::string string) |
Converts a string representation of an integer to an int . More... | |
STRINGS_API double | StringToDouble (std::string string) |
Converts a string representation of a double to a double . More... | |
STRINGS_API std::string | BytesToString (void *bytes, int bytes_length) |
Converts a series of bytes to a string. More... | |
STRINGS_API bool | IsStringInt (std::string string) |
Checks whether or not a string is a valid representation of an integer. More... | |
STRINGS_API bool | IsStringFloat (std::string string) |
Checks whether or not a string is a valid representation of a float. More... | |
Namespace containing functions to convert between various types of variables.
std::string BlamStrings::Converters::BytesToString | ( | void * | bytes, |
int | bytes_length | ||
) |
Converts a series of bytes to a string.
bytes | - Start address of the bytes to read. |
bytes_length | - The number of bytes to read. |
std::wstring BlamStrings::Converters::ConvertStringToWstring | ( | std::string | string | ) |
Converts a String to a Wide String.
string | - The string to convert. |
wstring
. bool BlamStrings::Converters::HexStringToChar | ( | std::string | hex, |
char * | character | ||
) |
Converts a hexadecimal code to its respective character.
This is used to evaluate a hex code representing a byte to its equivalent char
.
hex | - The string containing the hexadecimal representation of a character. |
character | - Pointer to the char to set to the evaluated character. |
true
if the character was converted successfully, false
if an error occurred. bool BlamStrings::Converters::IsStringFloat | ( | std::string | string | ) |
Checks whether or not a string is a valid representation of a float.
string | - The string to check. |
true
if the string represents a valid float, otherwise returns `false. bool BlamStrings::Converters::IsStringInt | ( | std::string | string | ) |
Checks whether or not a string is a valid representation of an integer.
string | - The string to check. |
true
if the string represents a valid integer, otherwise returns `false. bool BlamStrings::Converters::StringToBool | ( | std::string | string | ) |
Converts a string to a boolean.
The following will be interpreted as true
:
true, t, 1, on, yes, y
The following will be interpreted as false
:
false, f, 0, off, no, n
Any other value will return false
and add a message to console.
string | - The string to convert. |
bool
. double BlamStrings::Converters::StringToDouble | ( | std::string | string | ) |
Converts a string representation of a double to a double
.
string | - The string containing the double value representation. |
0
if the value failed to convert. float BlamStrings::Converters::StringToFloat | ( | std::string | string | ) |
Converts a string representation of a float to a float
.
string | - The string containing the float value representation. |
0.0f
if the value failed to convert. int BlamStrings::Converters::StringToInt | ( | std::string | string | ) |
Converts a string representation of an integer to an int
.
string | - The string containing the float value representation. |
0.0f
if the value failed to convert. std::string BlamStrings::Converters::WstringToString | ( | std::wstring | wide_string | ) |
Converts a Wide String to a String.
wide_string | - The wide string to convert. |
string
.