TypeConverter Class Reference

Utility class that converts between void* and char*. More...

List of all members.

Static Public Member Functions

static simba_string ConvertToString (SqlDataTypeUtilities &in_sqlTypeUtils, const void *in_source, simba_int16 in_sqlType, simba_uint32 in_srcLength, simba_uint32 in_targetLength, simba_int16 in_precision=0, simba_int16 in_scale=0, bool in_isUnsigned=false)
 Converts in_source into a simba_string.
static void ConvertToUTF8String (SqlDataTypeUtilities &in_sqlTypeUtils, SqlData *in_source, simba_string &out_result)
 Converts a SqlData to a UTF-8 string.
static simba_wstring ConvertToWString (SqlDataTypeUtilities &in_sqlTypeUtils, const void *in_source, simba_int16 in_sqlType, simba_uint32 in_srcLength, simba_uint32 in_targetLength, simba_int16 in_precision=0, simba_int16 in_scale=0, bool in_isUnsigned=false)
 Converts in_source into a simba_wstring.

Detailed Description

Utility class that converts between void* and char*.


Member Function Documentation

static simba_string ConvertToString ( SqlDataTypeUtilities in_sqlTypeUtils,
const void *  in_source,
simba_int16  in_sqlType,
simba_uint32  in_srcLength,
simba_uint32  in_targetLength,
simba_int16  in_precision = 0,
simba_int16  in_scale = 0,
bool  in_isUnsigned = false 
) [static]

Converts in_source into a simba_string.

Parameters:
in_sqlTypeUtils SqlDataTypeUtilities
in_source The source data to convert. (NOT OWN)
in_sqlType The SQL type of the source data to convert.
in_srcLength The length, in bytes, of the source data.
in_targetLength The length, in bytes, of the target converted data.
in_precision The precision of the in_source data.
in_scale The scale of the in_source data.
in_isUnsigned True if the source data is unsigned; false if it is signed.

NOTES: The target precision and scale will both be 0 since this is a conversion to a simba_string. in_precision, in_scale, and in_isUnsigned have default values so that they do not need to be passed in for SQL types where these values have no meaning. If in_source is a character or wide character type, their encodings are assumed to be the defaults as returned by simba_wstring::GetAnsiCharEncoding() and simba_wstring::GetDatabaseWCharEncoding().

Returns:
The converted simba_string for in_source. If in_source is NULL, returns an empty simba_string.
Exceptions:
SupportException if in_sqlType is an invalid type.
static void ConvertToUTF8String ( SqlDataTypeUtilities in_sqlTypeUtils,
SqlData in_source,
simba_string out_result 
) [static]

Converts a SqlData to a UTF-8 string.

Parameters:
in_sqlTypeUtils SqlDataTypeUtilities
in_source The source SqlData to convert. (NOT OWN).
out_result The output simba_string to write.
static simba_wstring ConvertToWString ( SqlDataTypeUtilities in_sqlTypeUtils,
const void *  in_source,
simba_int16  in_sqlType,
simba_uint32  in_srcLength,
simba_uint32  in_targetLength,
simba_int16  in_precision = 0,
simba_int16  in_scale = 0,
bool  in_isUnsigned = false 
) [static]

Converts in_source into a simba_wstring.

Parameters:
in_sqlTypeUtils SqlDataTypeUtilities
in_source The source data to convert. (NOT OWN)
in_sqlType The SQL type of the source data to convert.
in_srcLength The length, in bytes, of the source data.
in_targetLength The length, in bytes, of the converted target data.
in_precision The precision of the in_source data.
in_scale The scale of the in_source data.
in_isUnsigned True if the source data is unsigned; false if it is signed.

NOTES: The target precision and scale will both be 0 since this is a conversion to a simba_wstring. in_precision, in_scale, and in_isUnsigned have default values so that they do not need to be passed in for SQL types where these values have no meaning. If in_source is a character or wide character type, their encodings are assumed to be the defaults as returned by simba_wstring::GetAnsiCharEncoding() and simba_wstring::GetDatabaseWCharEncoding().

Returns:
The converted simba_wstring for in_source. If in_source is NULL, returns a NULL simba_wstring.
Exceptions:
SupportException if in_sqlType is an invalid SQL type.

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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba