![]() |
Murl Engine API
Version 2018.3
|
String conversion functions. More...
Functions | |
Bool | Murl::Util::StringToBool (const String &inputString, Bool &value) |
Convert a decimal string to a bool value. More... | |
Bool | Murl::Util::StringToUInt64 (const String &inputString, UInt64 &value) |
Convert a decimal string to a UInt64 value. More... | |
Bool | Murl::Util::StringToSInt64 (const String &inputString, SInt64 &value) |
Convert a decimal string to a SInt64 value. More... | |
Bool | Murl::Util::StringToUInt32 (const String &inputString, UInt32 &value) |
Convert a decimal string to a UInt32 value. More... | |
Bool | Murl::Util::StringToSInt32 (const String &inputString, SInt32 &value) |
Convert a decimal string to a SInt32 value. More... | |
Bool | Murl::Util::StringToDouble (const String &inputString, Double &value) |
Convert a string to a Double value. More... | |
Bool | Murl::Util::StringToFloat (const String &inputString, Float &value) |
Convert a string to a Float value. More... | |
Bool | Murl::Util::StringToColor (const String &inputString, Color &value, Color::StringFormat &format) |
Convert a string to a color object. More... | |
Bool | Murl::Util::StringToColor (const String &inputString, Color &value, Bool &hasType) |
Convert a string to a color object. More... | |
Bool | Murl::Util::StringToColor (const String &inputString, Color &value) |
Convert a string to a color object. More... | |
Bool | Murl::Util::StringToColorComponent (const String &inputString, Float &value, Color::StringFormat &format) |
Convert a string to a Float color component. More... | |
Bool | Murl::Util::StringToColorComponent (const String &inputString, Float &value, Bool &hasType) |
Convert a string to a Float color component. More... | |
Bool | Murl::Util::StringToColorComponent (const String &inputString, Float &value) |
Convert a string to a Float color component. More... | |
Bool | Murl::Util::HexStringToUInt64 (const String &inputString, UInt64 &value) |
Convert a hexadecimal string to a UInt64 value. More... | |
Bool | Murl::Util::HexStringToUInt32 (const String &inputString, UInt32 &value) |
Convert a hexadecimal string to a UInt32 value. More... | |
Bool | Murl::Util::AngleStringToDouble (const String &inputString, Double &value, Bool &hasUnit) |
Convert an angle string to a Double value. More... | |
Bool | Murl::Util::StringToBoolArray (const String &inputString, Char delimiter, BoolArray &values) |
Convert a string to a Bool array using a given delimiter. More... | |
Bool | Murl::Util::StringToUInt64Array (const String &inputString, Char delimiter, UInt64Array &values) |
Convert a string to a UInt64 array using a given delimiter. More... | |
Bool | Murl::Util::StringToSInt64Array (const String &inputString, Char delimiter, SInt64Array &values) |
Convert a string to a SInt64 array using a given delimiter. More... | |
Bool | Murl::Util::StringToUInt32Array (const String &inputString, Char delimiter, UInt32Array &values) |
Convert a string to a UInt32 array using a given delimiter. More... | |
Bool | Murl::Util::StringToSInt32Array (const String &inputString, Char delimiter, SInt32Array &values) |
Convert a string to a SInt32 array using a given delimiter. More... | |
Bool | Murl::Util::StringToDoubleArray (const String &inputString, Char delimiter, DoubleArray &values) |
Convert a string to a Double array using a given delimiter. More... | |
Bool | Murl::Util::StringToFloatArray (const String &inputString, Char delimiter, FloatArray &values) |
Convert a string to a Float array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToBoolArray (const String &inputString, Char delimiter, Bool *values, UInt32 numValues) |
Convert a string to a Bool array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToUInt64Array (const String &inputString, Char delimiter, UInt64 *values, UInt32 numValues) |
Convert a string to a UInt64 array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToSInt64Array (const String &inputString, Char delimiter, SInt64 *values, UInt32 numValues) |
Convert a string to a SInt64 array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToUInt32Array (const String &inputString, Char delimiter, UInt32 *values, UInt32 numValues) |
Convert a string to a UInt32 array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToSInt32Array (const String &inputString, Char delimiter, SInt32 *values, UInt32 numValues) |
Convert a string to a SInt32 array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToDoubleArray (const String &inputString, Char delimiter, Double *values, UInt32 numValues) |
Convert a string to a Double array using a given delimiter. More... | |
UInt32 | Murl::Util::StringToFloatArray (const String &inputString, Char delimiter, Float *values, UInt32 numValues) |
Convert a string to a Float array using a given delimiter. More... | |
String | Murl::Util::UInt64ToString (UInt64 inputValue) |
Convert a UInt64 value to a string. More... | |
String | Murl::Util::SInt64ToString (SInt64 inputValue) |
Convert a SInt64 value to a string. More... | |
String | Murl::Util::UInt32ToString (UInt32 inputValue) |
Convert a UInt32 value to a string. More... | |
String | Murl::Util::SInt32ToString (SInt32 inputValue) |
Convert a SInt32 value to a string. More... | |
String | Murl::Util::DoubleToString (Double inputValue) |
Convert a Double value to a string. More... | |
String | Murl::Util::ColorToString (const Color &inputValue) |
Convert a Color object to a string in float representation. More... | |
String | Murl::Util::ColorToString (const Color &inputValue, Color::StringFormat colorStringFormat) |
Convert a Color object to a string using a given color string format. More... | |
String | Murl::Util::UInt64ToString (UInt64 inputValue, const String &format) |
Convert a UInt64 value to a string using a format string. More... | |
String | Murl::Util::SInt64ToString (SInt64 inputValue, const String &format) |
Convert a SInt64 value to a string using a format string. More... | |
String | Murl::Util::UInt32ToString (UInt32 inputValue, const String &format) |
Convert a UInt32 value to a string using a format string. More... | |
String | Murl::Util::SInt32ToString (SInt32 inputValue, const String &format) |
Convert a SInt32 value to a string using a format string. More... | |
String | Murl::Util::DoubleToString (Double inputValue, const String &format) |
Convert a Double value to a string using a format string. More... | |
String | Murl::Util::ColorToString (const Color &inputValue, const String &format) |
Convert a Color object to a string in float representation. More... | |
String | Murl::Util::ColorToString (const Color &inputValue, Color::StringFormat colorStringFormat, const String &format) |
Convert a Color object to a string using a given color string format. More... | |
String | Murl::Util::BoolToString (Bool inputValue) |
Convert a Bool value to a string. More... | |
String | Murl::Util::TimeToString (const System::Time &inputValue) |
Convert a time value to a string. More... | |
String | Murl::Util::TimeToString (const System::Time &inputValue, const String &separator) |
Convert a time value to a string using a separator. More... | |
Bool | Murl::Util::Utf8ToWChar (const Char *inputBytes, UInt32 &numToSkip, WChar *outputValues, UInt32 &numValues) |
Convert an UTF8 character sequence to a wide-character. More... | |
Bool | Murl::Util::WCharToUtf8 (const WChar *inputValues, UInt32 &numToSkip, Char *outputBytes, UInt32 &numBytes) |
Convert a wide-character to an UTF8 character sequence. More... | |
Bool | Murl::Util::Utf8ToUtf16 (const Char *inputBytes, UInt32 &numToSkip, UInt16 *outputValues, UInt32 &numValues) |
Convert an UTF8 character sequence to an UTF16 character. More... | |
Bool | Murl::Util::Utf16ToUtf8 (const UInt16 *inputValues, UInt32 &numToSkip, Char *outputBytes, UInt32 &numBytes) |
Convert an UTF16 character to an UTF8 character sequence. More... | |
Bool | Murl::Util::Utf8ToUtf32 (const Char *inputBytes, UInt32 &outputValue, UInt32 &numToSkip) |
Convert an UTF8 character sequence to an UTF32 character. More... | |
Bool | Murl::Util::Utf32ToUtf8 (UInt32 inputValue, Char *outputBytes, UInt32 &numBytes) |
Convert an UTF32 character to an UTF8 character sequence. More... | |
String | Murl::Util::ValueToString (UInt64 inputValue) |
ValueToString overload for UInt64ToString() method. More... | |
String | Murl::Util::ValueToString (SInt64 inputValue) |
ValueToString overload for SInt64ToString() method. More... | |
String | Murl::Util::ValueToString (UInt32 inputValue) |
ValueToString overload for UInt32ToString() method. More... | |
String | Murl::Util::ValueToString (SInt32 inputValue) |
ValueToString overload for SInt32ToString() method. More... | |
String | Murl::Util::ValueToString (Double inputValue) |
ValueToString overload for DoubleToString() method. More... | |
String | Murl::Util::ValueToString (const Color &inputValue) |
ValueToString overload for ColorToString() method. More... | |
String | Murl::Util::ValueToString (Bool inputValue) |
ValueToString overload for BoolToString() method. More... | |
String | Murl::Util::ValueToString (const System::Time &inputValue) |
ValueToString overload for TimeToString() method. More... | |
String conversion functions.
Convert a decimal string to a bool value.
The conversion ignores case, leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a decimal string to a UInt64 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a decimal string to a SInt64 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a decimal string to a UInt32 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a decimal string to a SInt32 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a string to a Double value.
The conversion ignores leading and trailing whitespaces. The decimal separator is the '.' character (locale independent).
inputString | The string to convert. |
value | The return value. |
Convert a string to a Float value.
The conversion ignores leading and trailing whitespaces. The decimal separator is the '.' character (locale independent).
inputString | The string to convert. |
value | The return value. |
Bool Murl::Util::StringToColor | ( | const String & | inputString, |
Color & | value, | ||
Color::StringFormat & | format | ||
) |
Convert a string to a color object.
The conversion ignores case, leading and trailing whitespaces. A color value can be specified by comma separated component values or a single 32 bit hex value:
The component format specifiers are:
If a component has no format specifier the float format is assumed. If the string has only one component and the format specifier is missing, the "AARRGGBBh" format is assumed.
inputString | The string to convert. |
value | The color return value. |
format | This return value is set to the color string format recognized during conversion, or Color::STRING_FORMAT_UNKNOWN if failed. If different format specifiers are given, Color::STRING_FORMAT_MIXED is returned, and if not all of the given components have an explicit specifier, Color::STRING_FORMAT_INCOMPLETE is returned. |
Convert a string to a color object.
See StringToColor(const String& inputString, Color& value, Color::StringFormat& format).
inputString | The string to convert. |
value | The color return value. |
hasType | This return value is set to false if any format specifier is missing. |
Convert a string to a color object.
See StringToColor(const String& inputString, Color& value, Color::StringFormat& format).
inputString | The string to convert. |
value | The color return value. |
Bool Murl::Util::StringToColorComponent | ( | const String & | inputString, |
Float & | value, | ||
Color::StringFormat & | format | ||
) |
Convert a string to a Float color component.
The conversion ignores case, leading and trailing whitespaces. The component format specifiers are:
If the format specifier is missing the float format is assumed.
inputString | The string to convert. |
value | The color component return value. |
format | This return value is set to the color string format recognized during conversion, or Color::STRING_FORMAT_UNKNOWN if failed. If different format specifiers are given, Color::STRING_FORMAT_MIXED is returned, and if not all of the given components have an explicit specifier, Color::STRING_FORMAT_INCOMPLETE is returned. |
Bool Murl::Util::StringToColorComponent | ( | const String & | inputString, |
Float & | value, | ||
Bool & | hasType | ||
) |
Convert a string to a Float color component.
See StringToColorComponent(const String& inputString, Float& value, Color::StringFormat& format).
inputString | The string to convert. |
value | The color component return value. |
hasType | This return value is set to false if any format specifier is missing. |
Convert a string to a Float color component.
See StringToColorComponent(const String& inputString, Float& value, Color::StringFormat& format).
inputString | The string to convert. |
value | The color component return value. |
Convert a hexadecimal string to a UInt64 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert a hexadecimal string to a UInt32 value.
The conversion ignores leading and trailing whitespaces.
inputString | The string to convert. |
value | The return value. |
Convert an angle string to a Double value.
The conversion ignores case, leading and trailing whitespaces. An angle string can specify the unit:
If the unit specifier is missing the radiants unit is assumed.
inputString | The string to convert. |
value | The angle return value. |
hasUnit | This return value is set to false if the unit specifier is missing. |
Bool Murl::Util::StringToBoolArray | ( | const String & | inputString, |
Char | delimiter, | ||
BoolArray & | values | ||
) |
Convert a string to a Bool array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToUInt64Array | ( | const String & | inputString, |
Char | delimiter, | ||
UInt64Array & | values | ||
) |
Convert a string to a UInt64 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToSInt64Array | ( | const String & | inputString, |
Char | delimiter, | ||
SInt64Array & | values | ||
) |
Convert a string to a SInt64 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToUInt32Array | ( | const String & | inputString, |
Char | delimiter, | ||
UInt32Array & | values | ||
) |
Convert a string to a UInt32 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToSInt32Array | ( | const String & | inputString, |
Char | delimiter, | ||
SInt32Array & | values | ||
) |
Convert a string to a SInt32 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToDoubleArray | ( | const String & | inputString, |
Char | delimiter, | ||
DoubleArray & | values | ||
) |
Convert a string to a Double array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
Bool Murl::Util::StringToFloatArray | ( | const String & | inputString, |
Char | delimiter, | ||
FloatArray & | values | ||
) |
Convert a string to a Float array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | The return values array. |
UInt32 Murl::Util::StringToBoolArray | ( | const String & | inputString, |
Char | delimiter, | ||
Bool * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a Bool array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToUInt64Array | ( | const String & | inputString, |
Char | delimiter, | ||
UInt64 * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a UInt64 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToSInt64Array | ( | const String & | inputString, |
Char | delimiter, | ||
SInt64 * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a SInt64 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToUInt32Array | ( | const String & | inputString, |
Char | delimiter, | ||
UInt32 * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a UInt32 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToSInt32Array | ( | const String & | inputString, |
Char | delimiter, | ||
SInt32 * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a SInt32 array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToDoubleArray | ( | const String & | inputString, |
Char | delimiter, | ||
Double * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a Double array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
UInt32 Murl::Util::StringToFloatArray | ( | const String & | inputString, |
Char | delimiter, | ||
Float * | values, | ||
UInt32 | numValues | ||
) |
Convert a string to a Float array using a given delimiter.
inputString | The string to convert. |
delimiter | The delimiter character. |
values | Pointer to the return values array. |
numValues | The number of elements to write into the values array. |
Convert a UInt64 value to a string.
inputValue | The value to convert. |
Convert a SInt64 value to a string.
inputValue | The value to convert. |
Convert a UInt32 value to a string.
inputValue | The value to convert. |
Convert a SInt32 value to a string.
inputValue | The value to convert. |
Convert a Double value to a string.
inputValue | The value to convert. |
Convert a Color object to a string in float representation.
inputValue | The color to convert. |
String Murl::Util::ColorToString | ( | const Color & | inputValue, |
Color::StringFormat | colorStringFormat | ||
) |
Convert a Color object to a string using a given color string format.
inputValue | The color to convert. |
colorStringFormat | The color string format. |
Convert a UInt64 value to a string using a format string.
inputValue | The value to convert. |
format | The format string should contain "%llu". |
Convert a SInt64 value to a string using a format string.
inputValue | The value to convert. |
format | The format string should contain "%lld". |
Convert a UInt32 value to a string using a format string.
inputValue | The value to convert. |
format | The format string should contain "%u". |
Convert a SInt32 value to a string using a format string.
inputValue | The value to convert. |
format | The format string should contain "%d". |
Convert a Double value to a string using a format string.
inputValue | The value to convert. |
format | The format string should contain "%f" or "%g". |
Convert a Color object to a string in float representation.
inputValue | The color to convert. |
format | The format string should contain "%f" or "%g". |
String Murl::Util::ColorToString | ( | const Color & | inputValue, |
Color::StringFormat | colorStringFormat, | ||
const String & | format | ||
) |
Convert a Color object to a string using a given color string format.
inputValue | The color to convert. |
colorStringFormat | The color string format |
format | The format string should contain "%f" or "%g" for Color::STRING_FORMAT_FLOAT, "%i" or "%x" (or similar) for int and hex formats. |
Convert a Bool value to a string.
inputValue | The value to convert. |
String Murl::Util::TimeToString | ( | const System::Time & | inputValue | ) |
Convert a time value to a string.
inputValue | The value to convert. |
String Murl::Util::TimeToString | ( | const System::Time & | inputValue, |
const String & | separator | ||
) |
Convert a time value to a string using a separator.
inputValue | The value to convert. |
separator | The separator string. |
Bool Murl::Util::Utf8ToWChar | ( | const Char * | inputBytes, |
UInt32 & | numToSkip, | ||
WChar * | outputValues, | ||
UInt32 & | numValues | ||
) |
Convert an UTF8 character sequence to a wide-character.
For string operation the String class provides the GetWChars() method.
inputBytes | Pointer to the UTF8 character(s). |
numToSkip | Return value parameter returning the number of input bytes to skip to the next UTF8 character. |
outputValues | Pointer to the wide-character(s). |
numValues | In/out parameter. Must contain the number of values available in the output buffer; receives the actual number of values converted, on success. If the given number of values is smaller than the number of values needed, false is returned. |
Bool Murl::Util::WCharToUtf8 | ( | const WChar * | inputValues, |
UInt32 & | numToSkip, | ||
Char * | outputBytes, | ||
UInt32 & | numBytes | ||
) |
Convert a wide-character to an UTF8 character sequence.
For string operation the String class provides the SetWChars() method.
inputValues | Pointer to the wide-character(s). |
numToSkip | Return value parameter returning the number of input values (not the number of bytes!) to skip to the next wide-character. |
outputBytes | Pointer to a memory block to receive the converted bytes. |
numBytes | In/out parameter. Must contain the number of bytes available in the output buffer; receives the actual number of bytes converted, on success. If the given number of bytes is smaller than the number of bytes needed, false is returned. |
Bool Murl::Util::Utf8ToUtf16 | ( | const Char * | inputBytes, |
UInt32 & | numToSkip, | ||
UInt16 * | outputValues, | ||
UInt32 & | numValues | ||
) |
Convert an UTF8 character sequence to an UTF16 character.
For string operation the String class provides the GetUTF16Chars() method.
inputBytes | Pointer to the UTF8 character(s). |
numToSkip | Return value parameter returning the number of input bytes to skip to the next UTF8 character. |
outputValues | Pointer to the UTF-16 character(s). |
numValues | In/out parameter. Must contain the number of values available in the output buffer; receives the actual number of values converted, on success. If the given number of values is smaller than the number of values needed, false is returned. |
Bool Murl::Util::Utf16ToUtf8 | ( | const UInt16 * | inputValues, |
UInt32 & | numToSkip, | ||
Char * | outputBytes, | ||
UInt32 & | numBytes | ||
) |
Convert an UTF16 character to an UTF8 character sequence.
For string operation the String class provides the SetUTF16Chars() method.
inputValues | Pointer to the UTF16 character(s). |
numToSkip | Return value parameter returning the number of input values (not the number of bytes!) to skip to the next UTF16 character. |
outputBytes | Pointer to a memory block to receive the converted bytes. |
numBytes | In/out parameter. Must contain the number of bytes available in the output buffer; receives the actual number of bytes converted, on success. If the given number of bytes is smaller than the number of bytes needed, false is returned. |
Convert an UTF8 character sequence to an UTF32 character.
For string operation the String class provides the GetUTF32Chars() method.
inputBytes | Pointer to the UTF8 character(s). |
outputValue | The UTF-32 character return value. |
numToSkip | Return value parameter returning the number of input bytes to skip to the next UTF8 character. |
Convert an UTF32 character to an UTF8 character sequence.
For string operation the String class provides the SetUTF32Chars() method.
inputValue | The UTF32 character. |
outputBytes | Pointer to a memory block to receive the converted bytes. |
numBytes | In/out parameter. Must contain the number of bytes available in the output buffer; receives the actual number of bytes converted, on success. If the given number of bytes is smaller than the number of bytes needed, false is returned. |
ValueToString overload for UInt64ToString() method.
inputValue | The value to convert. |
ValueToString overload for SInt64ToString() method.
inputValue | The value to convert. |
ValueToString overload for UInt32ToString() method.
inputValue | The value to convert. |
ValueToString overload for SInt32ToString() method.
inputValue | The value to convert. |
ValueToString overload for DoubleToString() method.
inputValue | The value to convert. |
ValueToString overload for ColorToString() method.
inputValue | The value to convert. |
ValueToString overload for BoolToString() method.
inputValue | The value to convert. |
|
inline |
ValueToString overload for TimeToString() method.
inputValue | The value to convert. |