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 string &value)
 See above.
static string ToString (const fchar *value)
 Converts an Unicode string to a 8-bit string.
static string ToString (const fstring &value)
 See above.
static bool ToBoolean (const char *value)
 Parses a string into a boolean value.
static bool ToBoolean (const string &value)
 See above.
static bool ToBoolean (const fchar *value)
 See above.
static bool ToBoolean (const fstring &value)
 See above.
static float ToFloat (const char **value)
 Parses a string into a floating-point value.
static float ToFloat (const char *value)
 See above.
static float ToFloat (const string &value)
 See above.
static float ToFloat (const fchar **value)
 See above.
static float ToFloat (const fstring &value)
 See above.
static float ToFloat (const fchar *value)
 See above.
static int32 ToInt32 (const char **value)
 Parses a string into a signed integer.
static int32 ToInt32 (const char *value)
 See above.
static int32 ToInt32 (const string &value)
 See above.
static int32 ToInt32 (const fchar **value)
 See above.
static int32 ToInt32 (const fchar *value)
 See above.
static int32 ToInt32 (const fstring &value)
 See above.
static uint32 ToUInt32 (const char **value)
 Parses a string into an unsigned integer.
static uint32 ToUInt32 (const char *value)
 See above.
static uint32 ToUInt32 (const string &value)
 See above.
static uint32 ToUInt32 (const fchar **value)
 See above.
static uint32 ToUInt32 (const fchar *value)
 See above.
static uint32 ToUInt32 (const fstring &value)
 See above.
static uint32 HexToUInt32 (const char **value, uint32 count=UINT_MAX)
 Parses a string into an unsigned integer.
static uint32 HexToUInt32 (const char *value, uint32 count=UINT_MAX)
 See above.
static uint32 HexToUInt32 (const string &value, uint32 count=UINT_MAX)
 See above.
static uint32 HexToUInt32 (const fchar **value, uint32 count=UINT_MAX)
 See above.
static uint32 HexToUInt32 (const fchar *value, uint32 count=UINT_MAX)
 See above.
static uint32 HexToUInt32 (const fstring &value, uint32 count=UINT_MAX)
 See above.
static FMVector3 ToPoint (const char **value, float lengthFactor=1.0f)
 Parses a string into a 3D vector.
static FMVector3 ToPoint (const char *value, float lengthFactor=1.0f)
 See above.
static FMVector3 ToPoint (const string &value, float lengthFactor=1.0f)
 See above.
static FMVector3 ToPoint (const fchar **value, float lengthFactor=1.0f)
 See above.
static FMVector3 ToPoint (const fchar *value, float lengthFactor=1.0f)
 See above.
static FMVector3 ToPoint (const fstring &value, float lengthFactor=1.0f)
 See above.
static void ToMatrix (const char **value, FMMatrix44 &mx, float lengthFactor=1.0f)
 Parses a string into a 4x4 matrix.
static void ToMatrix (const char *value, FMMatrix44 &mx, float lengthFactor=1.0f)
 See above.
static void ToMatrix (const string &value, FMMatrix44 &mx, float lengthFactor=1.0f)
 See above.
static void ToMatrix (const fchar **value, FMMatrix44 &mx, float lengthFactor=1.0f)
 See above.
static void ToMatrix (const fchar *value, FMMatrix44 &mx, float lengthFactor=1.0f)
 See above.
static void ToMatrix (const fstring &value, FMMatrix44 &mx, float lengthFactor=1.0f)
 See above.
static void ToDateTime (const char *value, FUDateTime &dateTime)
 Parses a string into a datetime structure.
static void ToDateTime (const string &value, FUDateTime &dateTime)
 See above.
static void ToDateTime (const fchar *value, FUDateTime &dateTime)
 See above.
static void ToDateTime (const fstring &value, FUDateTime &dateTime)
 See above.
static void ToFStringList (const fstring &value, FStringList &array)
 Splits a string into multiple substrings.
static void ToStringList (const string &value, StringList &array)
 See above.
static void ToStringList (const fchar *value, StringList &array)
 See above.
static void ToStringList (const fstring &value, StringList &array)
 See above.
static void ToFloatList (const char *value, FloatList &array)
 Parses a string into a list of floating point values.
static void ToFloatList (const string &value, FloatList &array)
 See above.
static void ToFloatList (const fchar *value, FloatList &array)
 See above.
static void ToFloatList (const fstring &value, FloatList &array)
 See above.
static void ToInt32List (const char *value, Int32List &array)
 Parses a string into a list of signed integers.
static void ToInt32List (const string &value, Int32List &array)
 See above.
static void ToInt32List (const fchar *value, Int32List &array)
 See above.
static void ToInt32List (const fstring &value, Int32List &array)
 See above.
static void ToUInt32List (const char *value, UInt32List &array)
 Parses a string into a list of unsigned integers.
static void ToUInt32List (const string &value, UInt32List &array)
 See above.
static void ToUInt32List (const fchar *value, UInt32List &array)
 See above.
static void ToUInt32List (const fstring &value, UInt32List &array)
 See above.
static void ToInterleavedFloatList (const char *value, const vector< FloatList * > &arrays)
 Parses a string containing interleaved floating-point values.
static void ToInterleavedFloatList (const string &value, const vector< FloatList * > &arrays)
 See above.
static void ToInterleavedFloatList (const fchar *value, const vector< FloatList * > &arrays)
 See above.
static void ToInterleavedFloatList (const fstring &value, const vector< FloatList * > &arrays)
 See above.
static void ToMatrixList (const char *value, FMMatrix44List &array, float lengthFactor=1.0f)
 Parses a string into a list of matrices.
static void ToMatrixList (const string &value, FMMatrix44List &array, float lengthFactor=1.0f)
 See above.
static void ToMatrixList (const fchar *value, FMMatrix44List &array, float lengthFactor=1.0f)
 See above.
static void ToMatrixList (const fstring &value, FMMatrix44List &array, float lengthFactor=1.0f)
 See above.
static void ToPointList (const char *value, FMVector3List &array, float lengthFactor=1.0f)
 Parses a string into a list of 3D points.
static void ToPointList (const string &value, FMVector3List &array, float lengthFactor=1.0f)
 See above.
static void ToPointList (const fchar *value, FMVector3List &array, float lengthFactor=1.0f)
 See above.
static void ToPointList (const fstring &value, FMVector3List &array, float lengthFactor=1.0f)
 See above.
static void ToString (FUSStringBuilder &builder, const FloatList &values, float lengthFactor=1.0f)
 Converts a list of floating-point values into a string.
static void ToString (FUSStringBuilder &builder, const Int32List &values)
 Converts a list of signed integers into a string.
static void ToString (FUSStringBuilder &builder, const UInt32List &values)
 Converts a list of unsigned integers into a string.
static string ToString (const FMVector4 &p, float lengthFactor=1.0f)
 Converts a 4D vector into a string.
static string ToString (const FMMatrix44 &value, float lengthFactor=1.0f)
 Converts a matrix into a string.
static fstring ToFString (const FMMatrix44 &value, float lengthFactor=1.0f)
 See above.
static string ToString (const FMVector3 &value, float lengthFactor=1.0f)
 Converts a 3D vector into a string.
static fstring ToFString (const FMVector3 &value, float lengthFactor=1.0f)
 See above.
static string ToString (const FUDateTime &dateTime)
 Converts a datetime structure into a string.
static fstring ToFString (const FUDateTime &dateTime)
 See above.
template<typename T>
static string ToString (const T &value)
 Converts a primitive value into a string.
template<typename T>
static fstring ToFString (const T &value)
 See above.
static void ToString (FUSStringBuilder &builder, const FMMatrix44 &value, float lengthFactor=1.0f)
 Converts a matrix into a string.
static void ToFString (FUStringBuilder &builder, const FMMatrix44 &value, float lengthFactor=1.0f)
 See above.
static void ToString (FUSStringBuilder &builder, const FMVector3 &value, float lengthFactor=1.0f)
 Converts a 3D vector into a string.
static void ToFString (FUStringBuilder &builder, const FMVector3 &value, float lengthFactor=1.0f)
 See above.
static void ToString (FUSStringBuilder &builder, const FMVector4 &p, float lengthFactor=1.0f)
 Converts a 4D vector into a string.


Detailed Description

Common string conversion.

This static class contains the parsing function for Unicode and 8-bit/UTF-8 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.


Member Function Documentation

static uint32 FUStringConversion::HexToUInt32 const char **  value,
uint32  count = UINT_MAX
[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 bool FUStringConversion::ToBoolean const char *  value  )  [static]
 

Parses a string into a boolean value.

Parameters:
value The string.
Returns:
The parsed boolean value.

static void FUStringConversion::ToDateTime const char *  value,
FUDateTime dateTime
[static]
 

Parses a string into a datetime structure.

Parameters:
value The string.
dateTime The datetime structure to fill in.

static float FUStringConversion::ToFloat const char **  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.

static void FUStringConversion::ToFloatList const char *  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.

static int32 FUStringConversion::ToInt32 const char **  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.

static void FUStringConversion::ToInt32List const char *  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.

static void FUStringConversion::ToInterleavedFloatList const char *  value,
const vector< 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.

static void FUStringConversion::ToMatrix const char **  value,
FMMatrix44 mx,
float  lengthFactor = 1.0f
[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.
lengthFactor An optional factor that will scale the translation column of the matrix.

static void FUStringConversion::ToMatrixList const char *  value,
FMMatrix44List array,
float  lengthFactor = 1.0f
[static]
 

Parses a string into a list of matrices.

Parameters:
value The string.
array The list of matrices to fill in.
lengthFactor An optional factor that will scale the translation column of the matrices.

static FMVector3 FUStringConversion::ToPoint const char **  value,
float  lengthFactor = 1.0f
[static]
 

Parses a string into a 3D 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.
lengthFactor An optional factor that will scale the 3D vector.
Returns:
The parsed 3D vector.

static void FUStringConversion::ToPointList const char *  value,
FMVector3List array,
float  lengthFactor = 1.0f
[static]
 

Parses a string into a list of 3D points.

Parameters:
value The string.
array The list of 3D points to fill in.
lengthFactor An optional factor that will scale the points.

static void FUStringConversion::ToString FUSStringBuilder builder,
const FMVector4 p,
float  lengthFactor = 1.0f
[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.
lengthFactor An optional factor that will scale the vector.

static void FUStringConversion::ToString FUSStringBuilder builder,
const FMVector3 value,
float  lengthFactor = 1.0f
[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.
lengthFactor An optional factor that will scale the vector.

static void FUStringConversion::ToString FUSStringBuilder builder,
const FMMatrix44 value,
float  lengthFactor = 1.0f
[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.
lengthFactor An optional factor that will scale the translation column of the matrix.

template<typename T>
static 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 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 string FUStringConversion::ToString const FMVector3 value,
float  lengthFactor = 1.0f
[static]
 

Converts a 3D vector into a string.

Parameters:
value The 3D vector to convert.
lengthFactor An optional factor that will scale the vector.
Returns:
The string containing the converted vector.

static string FUStringConversion::ToString const FMMatrix44 value,
float  lengthFactor = 1.0f
[static]
 

Converts a matrix into a string.

Parameters:
value The matrix to convert.
lengthFactor An optional factor that will scale the translation column of the matrix.
Returns:
The string containing the converted matrix.

static string FUStringConversion::ToString const FMVector4 p,
float  lengthFactor = 1.0f
[static]
 

Converts a 4D vector into a string.

Parameters:
p The 4D vector to convert.
lengthFactor An optional factor that will scale the vector.
Returns:
The string containing the converted vector.

static void FUStringConversion::ToString FUSStringBuilder builder,
const UInt32List values
[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.

static void FUStringConversion::ToString FUSStringBuilder 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.

static void FUStringConversion::ToString FUSStringBuilder builder,
const FloatList values,
float  lengthFactor = 1.0f
[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.
lengthFactor An optional factor that will scale all the floating-point values.

static 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.

static uint32 FUStringConversion::ToUInt32 const char **  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.

static void FUStringConversion::ToUInt32List const char *  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.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:44 2006 for FCollada by  doxygen 1.4.6-NO