- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FUStringConversion Class Reference
[Utility Classes.]

Common string conversion. More...

`#include <FUStringConversion.h>`

List of all members.

## Static Public Member Functions
static fstring | ToFString (const char *value)
| Converts a 8-bit string to a Unicode string.
static fstring | ToFString (const fm::string &value)
| See above.
static fm::string | ToString (const fchar *value)
| Converts an Unicode string to a 8-bit string.
static fm::string | ToString (const fstring &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT bool | ToBoolean (const CH *value)
| Parses a string into a boolean value.
template<class CH>
static bool | ToBoolean (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT float | ToFloat (const CH **value)
| Parses a string into a floating-point value.
template<class CH>
static float | ToFloat (const CH *value)
| See above.
template<class CH>
static float | ToFloat (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT int32 | ToInt32 (const CH **value)
| Parses a string into a signed integer.
template<class CH>
static int32 | ToInt32 (const CH *value)
| See above.
template<class CH>
static int32 | ToInt32 (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT uint32 | ToUInt32 (const CH **value)
| Parses a string into an unsigned integer.
template<class CH>
static uint32 | ToUInt32 (const CH *value)
| See above.
template<class CH>
static uint32 | ToUInt32 (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT uint32 | HexToUInt32 (const CH **value, uint32 count=1)
| Parses a string into an unsigned integer.
template<class CH>
static uint32 | HexToUInt32 (const CH *value, uint32 count=1)
| See above.
template<class CH>
static uint32 | HexToUInt32 (const fm::stringT< CH > &value, uint32 count=1)
| See above.
template<class CH>
static FCOLLADA_EXPORT FMVector2 | ToVector2 (const CH **value)
| Parses a string into a vector.
template<class CH>
static FMVector2 | ToVector2 (const CH *value)
| See above.
template<class CH>
static FMVector2 | ToVector2 (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT FMVector3 | ToVector3 (const CH **value)
| See above.
template<class CH>
static FMVector3 | ToVector3 (const CH *value)
| See above.
template<class CH>
static FMVector3 | ToVector3 (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT FMVector4 | ToVector4 (const CH **value)
| See above.
template<class CH>
static FMVector4 | ToVector4 (const CH *value)
| See above.
template<class CH>
static FMVector4 | ToVector4 (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToMatrix (const CH **value, FMMatrix44 &mx)
| Parses a string into a 4x4 matrix.
template<class CH>
static void | ToMatrix (const CH *value, FMMatrix44 &mx)
| See above.
template<class CH>
static void | ToMatrix (const fm::stringT< CH > &value, FMMatrix44 &mx)
| See above.
template<class CH>
static FMMatrix44 | ToMatrix (const CH *value)
| See above.
template<class CH>
static FMMatrix44 | ToMatrix (const fm::stringT< CH > &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToDateTime (const CH *value, FUDateTime &dateTime)
| Parses a string into a datetime structure.
template<class CH>
static void | ToDateTime (const fm::stringT< CH > &value, FUDateTime &dateTime)
| See above.
static void | ToFStringList (const fstring &value, FStringList &array)
| Splits a string into multiple substrings.
static void | ToStringList (const char *value, StringList &array)
| See above.
static void | ToStringList (const fchar *value, StringList &array)
| See above.
template<class CH>
static void | ToStringList (const fm::stringT< CH > &value, StringList &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToBooleanList (const CH *value, BooleanList &array)
| Parses a string into a list of boolean values.
template<class CH>
static void | ToBooleanList (const fm::stringT< CH > &value, BooleanList &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToFloatList (const CH *value, FloatList &array)
| Parses a string into a list of floating point values.
template<class CH>
static void | ToFloatList (const fm::stringT< CH > &value, FloatList &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToInt32List (const CH *value, Int32List &array)
| Parses a string into a list of signed integers.
template<class CH>
static void | ToInt32List (const fm::stringT< CH > &value, Int32List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToUInt32List (const CH *value, UInt32List &array)
| Parses a string into a list of unsigned integers.
template<class CH>
static void | ToUInt32List (const fm::stringT< CH > &value, UInt32List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToInterleavedFloatList (const CH *value, fm::pvector< FloatList > &arrays)
| Parses a string containing interleaved floating-point values.
template<class CH>
static void | ToInterleavedFloatList (const fm::stringT< CH > &value, fm::pvector< FloatList > &arrays)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToInterleavedUInt32List (const CH *value, fm::pvector< UInt32List > &arrays)
| Parses a string containing interleaved unsigned integers.
template<class CH>
static void | ToInterleavedUInt32List (const fm::stringT< CH > &value, fm::pvector< UInt32List > &arrays)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToMatrixList (const CH *value, FMMatrix44List &array)
| Parses a string into a list of matrices.
template<class CH>
static void | ToMatrixList (const fm::stringT< CH > &value, FMMatrix44List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToVector2List (const CH *value, FMVector2List &array)
| Parses a string into a list of 2D vectors.
template<class CH>
static void | ToVector2List (const fm::stringT< CH > &value, FMVector2List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToVector3List (const CH *value, FMVector3List &array)
| Parses a string into a list of 3D vectors.
template<class CH>
static void | ToVector3List (const fm::stringT< CH > &value, FMVector3List &array)
| See above.
template<class CH>
static void | ToPointList (const CH *value, FMVector3List &array)
template<class CH>
static void | ToPointList (const fm::stringT< CH > &value, FMVector3List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToVector4List (const CH *value, FMVector4List &array)
| Parses a string into a list of 4D vectors.
template<class CH>
static void | ToVector4List (const fm::stringT< CH > &value, FMVector4List &array)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const FloatList &values)
| Converts a list of floating-point values into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const Int32List &values)
| Converts a list of signed integers into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const UInt32List &values)
| Converts a list of unsigned integers into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const uint32 *values, size_t count)
| Converts a list of unsigned integers into a string.
static fm::string | ToString (const FMVector4 &p)
| Converts a 4D vector into a string.
static fstring | ToFString (const FMVector4 &p)
| See above.
static fm::string | ToString (const FMMatrix44 &value)
| Converts a matrix into a string.
static fstring | ToFString (const FMMatrix44 &value)
| See above.
static fm::string | ToString (const FMVector2 &value)
| Converts a 2D vector into a string.
static fstring | ToFString (const FMVector2 &value)
| See above.
static fm::string | ToString (const FMVector3 &value)
| Converts a 3D vector into a string.
static fstring | ToFString (const FMVector3 &value)
| See above.
static fm::string | ToString (const FUDateTime &dateTime)
| Converts a datetime structure into a string.
static fstring | ToFString (const FUDateTime &dateTime)
| See above.
template<class T>
static fm::string | ToString (const T &value)
| Converts a primitive value into a string.
template<class T>
static fstring | ToFString (const T &value)
| See above.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const FMMatrix44 &value)
| Converts a matrix into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const FMVector2 &value)
| Converts a 2D vector into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const FMVector3 &value)
| Converts a 3D vector into a string.
template<class CH>
static FCOLLADA_EXPORT void | ToString (FUStringBuilderT< CH > &builder, const FMVector4 &p)
| Converts a 4D vector into a string.
static void | SplitTarget (const fm::string &target, fm::string &pointer, fm::string &qualifier)
| Split the target string into its pointer and its qualifier(s) Used by the animation system to split to find the animation targets.
static int32 | ParseQualifier (const char *string)
| Parses the input string for a qualifier for the animation system.
static int32 | ParseQualifier (const fm::string &string)
template<class CH>
static FCOLLADA_EXPORT size_t | CountValues (const CH *sz)
| Count the number of values to expect within this string.

## Detailed Description

Common string conversion.

This static class contains the parsing function for Unicode and 8-bit/UTF-8 fm::strings into common data types: integers, booleans, floating-point values, vectors, matrices, date-time, etc. and dynamically-sized array of these types.

This class can also convert common data types into an 8-bit or a Unicode string and it contains conversion functions to convert string between 8-bit and Unicode.

All the functions which return string objects are returning static string objects in order for DLLs to work correctly with non-local heaps. If you are interested in the value of the conversion: save it into a local string object.

## Member Function Documentation

template<class CH>
FCOLLADA_EXPORT size_t FUStringConversion::CountValues | ( | const CH * | sz | ) | `[static]`

  | Count the number of values to expect within this string. This function assumes that the tokens are separated by white spaces. This function is useful to pre-allocate value arrays. Parameters:
  | sz | The string whose values to count.
Returns: The expected number of values.

template<class CH>
FCOLLADA_EXPORT uint32 FUStringConversion::HexToUInt32 | ( | const CH ** | value,
|  | uint32 | count = `1`
| ) | `[static]`

  | Parses a string into an unsigned integer. The string is assumed to have an unsigned integer in hexadecimal format. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
  | count | The maxmimum number of characters to parse. For example, a count of 2 will read in an 8-bit character.
Returns: The parsed unsigned integer.

static int32 FUStringConversion::ParseQualifier | ( | const char * | string | ) | `[static]`

  | Parses the input string for a qualifier for the animation system. Basically extracts a number from either [XX] or (XX) Parameters:
  | string | The input string to parse the number from
Returns: The qualifier if found, -1 if not.

template<class CH>
FCOLLADA_EXPORT bool FUStringConversion::ToBoolean | ( | const CH * | value | ) | `[static]`

  | Parses a string into a boolean value. Parameters:
  | value | The string.
Returns: The parsed boolean value.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToBooleanList | ( | const CH * | value,
|  | BooleanList & | array
| ) | `[static]`

  | Parses a string into a list of boolean values. Parameters:
  | value | The string.
  | array | The list of boolean values to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToDateTime | ( | const CH * | value,
|  | FUDateTime & | dateTime
| ) | `[static]`

  | Parses a string into a datetime structure. Parameters:
  | value | The string.
  | dateTime | The datetime structure to fill in.

template<class CH>
FCOLLADA_EXPORT float FUStringConversion::ToFloat | ( | const CH ** | value | ) | `[static]`

  | Parses a string into a floating-point value. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
Returns: The parsed floating-point value.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToFloatList | ( | const CH * | value,
|  | FloatList & | array
| ) | `[static]`

  | Parses a string into a list of floating point values. Parameters:
  | value | The string.
  | array | The list of floating point values to fill in.

static fstring FUStringConversion::ToFString | ( | const char * | value | ) | `[static]`

  | Converts a 8-bit string to a Unicode string. Parameters:
  | value | The 8-bit string.
Returns: The converted Unicode string.

static void FUStringConversion::ToFStringList | ( | const fstring & | value,
|  | FStringList & | array
| ) | `[static]`

  | Splits a string into multiple substrings. The separator used here are the white-spaces. Parameters:
  | value | The string.
  | array | A list of strings that will be filled in.

template<class CH>
FCOLLADA_EXPORT int32 FUStringConversion::ToInt32 | ( | const CH ** | value | ) | `[static]`

  | Parses a string into a signed integer. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
Returns: The parsed signed integer.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToInt32List | ( | const CH * | value,
|  | Int32List & | array
| ) | `[static]`

  | Parses a string into a list of signed integers. Parameters:
  | value | The string.
  | array | The list of signed integers to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToInterleavedFloatList | ( | const CH * | value,
|  | fm::pvector< FloatList > & | arrays
| ) | `[static]`

  | Parses a string containing interleaved floating-point values. The values will be stored in multiple, independent lists. Parameters:
  | value | The string containing interleaved floating-point values.
  | arrays | The lists of floating-point values to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToInterleavedUInt32List | ( | const CH * | value,
|  | fm::pvector< UInt32List > & | arrays
| ) | `[static]`

  | Parses a string containing interleaved unsigned integers. The values will be stored in multiple, independent lists. Parameters:
  | value | The string containing interleaved unsigned integers.
  | arrays | The lists of unsigned integers to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToMatrix | ( | const CH ** | value,
|  | FMMatrix44 & | mx
| ) | `[static]`

  | Parses a string into a 4x4 matrix. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
  | mx | The matrix to be filled in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToMatrixList | ( | const CH * | value,
|  | FMMatrix44List & | array
| ) | `[static]`

  | Parses a string into a list of matrices. Parameters:
  | value | The string.
  | array | The list of matrices to fill in.

template<class CH>
static void FUStringConversion::ToPointList | ( | const CH * | value,
|  | FMVector3List & | array
| ) | `[inline, static]`

  | Deprecated: Parses a string into a list of 3D points. Now replaced by ToVector3List. Parameters:
  | value | The string.
  | array | The list of 3D points to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const FMVector4 & | p
| ) | `[static]`

  | Converts a 4D vector into a string. Parameters:
  | builder | The string builder that will contain the 4D vector. This string builder is not cleared of its contents.
  | p | The 4D vector to convert.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const FMVector3 & | value
| ) | `[static]`

  | Converts a 3D vector into a string. Parameters:
  | builder | The string builder that will contain the 3D vector. This string builder is not cleared of its contents.
  | value | The 3D vector to convert.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const FMVector2 & | value
| ) | `[static]`

  | Converts a 2D vector into a string. Parameters:
  | builder | The string builder that will contain the 2D vector. This string builder is not cleared of its contents.
  | value | The 2D vector to convert.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const FMMatrix44 & | value
| ) | `[static]`

  | Converts a matrix into a string. Parameters:
  | builder | The string builder that will contain the matrix. This string builder is not cleared of its contents.
  | value | The matrix to convert.

template<class T>
static fm::string FUStringConversion::ToString | ( | const T & | value | ) | `[inline, static]`

  | Converts a primitive value into a string. This function is templatized to use the global string builders to convert most primitive value types, such as signed integers, unsigned integers and single floating-point values, into strings. See also: FUStringBuilderT Parameters:
  | value | A primitive value.
Returns: The string containing the converted primitive value.

static fm::string FUStringConversion::ToString | ( | const FUDateTime & | dateTime | ) | `[static]`

  | Converts a datetime structure into a string. Parameters:
  | dateTime | The datetime structure to convert.
Returns: The string containing the converted datetime structure.

static fm::string FUStringConversion::ToString | ( | const FMVector3 & | value | ) | `[static]`

  | Converts a 3D vector into a string. Parameters:
  | value | The 3D vector to convert.
Returns: The string containing the converted vector.

static fm::string FUStringConversion::ToString | ( | const FMVector2 & | value | ) | `[static]`

  | Converts a 2D vector into a string. Parameters:
  | value | The 2D vector to convert.
Returns: The string containing the converted vector.

static fm::string FUStringConversion::ToString | ( | const FMMatrix44 & | value | ) | `[static]`

  | Converts a matrix into a string. Parameters:
  | value | The matrix to convert.
Returns: The string containing the converted matrix.

static fm::string FUStringConversion::ToString | ( | const FMVector4 & | p | ) | `[static]`

  | Converts a 4D vector into a string. Parameters:
  | p | The 4D vector to convert.
Returns: The string containing the converted vector.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const uint32 * | values,
|  | size_t | count
| ) | `[static]`

  | Converts a list of unsigned integers into a string. Parameters:
  | builder | The string builder that will contain the list of values. This string builder is not cleared of its contents and a space character will be added if it is not empty.
  | values | The contiguous array of unsigned integers to convert.
  | count | The number of values in the contiguous array.

template<class CH>
static FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const UInt32List & | values
| ) | `[inline, static]`

  | Converts a list of unsigned integers into a string. Parameters:
  | builder | The string builder that will contain the list of values. This string builder is not cleared of its contents and a space character will be added if it is not empty.
  | values | The list of unsigned integers to convert.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const Int32List & | values
| ) | `[static]`

  | Converts a list of signed integers into a string. Parameters:
  | builder | The string builder that will contain the list of values. This string builder is not cleared of its contents and a space character will be added if it is not empty.
  | values | The list of signed integers to convert.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToString | ( | FUStringBuilderT< CH > & | builder,
|  | const FloatList & | values
| ) | `[static]`

  | Converts a list of floating-point values into a string. Parameters:
  | builder | The string builder that will contain the list of values. This string builder is not cleared of its contents and a space character will be added if it is not empty.
  | values | The list of floating-point values to convert.

static fm::string FUStringConversion::ToString | ( | const fchar * | value | ) | `[static]`

  | Converts an Unicode string to a 8-bit string. Parameters:
  | value | The Unicode string.
Returns: The converted 8-bit string.

template<class CH>
FCOLLADA_EXPORT uint32 FUStringConversion::ToUInt32 | ( | const CH ** | value | ) | `[static]`

  | Parses a string into an unsigned integer. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
Returns: The parsed unsigned integer.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToUInt32List | ( | const CH * | value,
|  | UInt32List & | array
| ) | `[static]`

  | Parses a string into a list of unsigned integers. Parameters:
  | value | The string.
  | array | The list of unsigned integers to fill in.

template<class CH>
FCOLLADA_EXPORT FMVector2 FUStringConversion::ToVector2 | ( | const CH ** | value | ) | `[static]`

  | Parses a string into a vector. Parameters:
  | value | The string. For the string pointer versions of this function, the pointer will point to the last processed characters after the parsing.
Returns: The parsed vector.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToVector2List | ( | const CH * | value,
|  | FMVector2List & | array
| ) | `[static]`

  | Parses a string into a list of 2D vectors. Parameters:
  | value | The string.
  | array | The list of 2D vectors to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToVector3List | ( | const CH * | value,
|  | FMVector3List & | array
| ) | `[static]`

  | Parses a string into a list of 3D vectors. Parameters:
  | value | The string.
  | array | The list of 3D vectors to fill in.

template<class CH>
FCOLLADA_EXPORT void FUStringConversion::ToVector4List | ( | const CH * | value,
|  | FMVector4List & | array
| ) | `[static]`

  | Parses a string into a list of 4D vectors. Parameters:
  | value | The string.
  | array | The list of 4D vectors to fill in.

The documentation for this class was generated from the following files:

- FUtils/FUStringConversion.h
- FUtils/FUStringConversion.hpp