Text parsing and formatting.
Text parsing and formatting.
int Text::ParseInt(const string&in str, int base = 10)
Parses the given string as an integer.
int int64 Text::ParseInt64(const string&in str, int base = 10)
Parses the given string as a 64 bit integer.
int64 uint Text::ParseUInt(const string&in str, int base = 10)
Parses the given string as an unsigned integer.
uint uint64 Text::ParseUInt64(const string&in str, int base = 10)
Parses the given string as a 64 bit unsigned integer.
uint64 vec4 Text::ParseHexColor(string str)
Parses the given string as a hexadecimal color such as "#FF0000".
vec4 bool Text::TryParseInt(const string&in str, int&out, int base = 10)
Tries to parse the given string as an integer. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseInt64(const string&in str, int64&out, int base = 10)
Tries to parse the given string as a 64 bit integer. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseUInt(const string&in str, int&out, int base = 10)
Tries to parse the given string as an unsigned integer. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseUInt64(const string&in str, int64&out, int base = 10)
Tries to parse the given string as a 64 bit unsigned integer. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseFloat(const string&in str, float&out)
Parses the given string as a float. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseDouble(const string&in str, double&out)
Parses the given string as a double. This will return true only if the string was parsed entirely and was not empty.
bool bool Text::TryParseHexColor(string str, vec4&out)
Parses the given string as a hexadecimal color such as "#FF0000". This will return true only if the string was parsed entirely and was not empty.
bool string Text::FormatPointer(uint64 ptr)
Formats a pointer to its more representative hexadecimal format, for example: 0x12345678
string string Text::FormatGameColor(const vec3&in rgb)
Formats a color in Maniaplanet-style color formatting, for example: "$f00"
string string Text::FormatOpenplanetColor(const vec3&in rgb)
Formats a color in Openplanet-style UI color formatting, for example: "\$f00"
string string Text::StripFormatCodes(const string&in s)
Strips all Maniaplanet-style formatting codes from a string.
string string Text::StripNonColorFormatCodes(const string&in s)
Strips all non-color Maniaplanet-style formatting codes from a string.
string string Text::OpenplanetFormatCodes(const string&in s)
Takes a string, converts Maniaplanet-style formatting codes and turns them into Openplanet UI formatting codes. This will also get rid of all Openplanet-unsupported formatting codes.
string string Text::StripOpenplanetFormatCodes(const string&in s)
Strips all Openplanet-supported formatting codes from a string.
string string Text::EncodeHex(const string&in, bool upper = false)
Encodes a string so that all characters are encoded as a sequence of hexadecimal bytes. Note that if you want to encode binary data, you should probably use MemoryBuffer::ReadToHex instead.
string string Text::DecodeHex(const string&in)
Decodes a string where characters are encoded as a sequence of hexadecimal bytes. Note that if you want to decode binary data, you should probably use MemoryBuffer::WriteFromHex instead.
string string Text::EncodeBase64(const string&in, bool url = false)
Encode a string as a base64 encoded string. Note that if you want to encode binary data, you should probably use MemoryBuffer::ReadToBase64 instead.
string string Text::DecodeBase64(const string&in, bool url = false)
Decode a base64 encoded string to a string. Note that if you want to decode binary data, you should probably use MemoryBuffer::WriteFromBase64 instead.
string