DSITypeUtilities Class Reference

Provides utilities for handling data types. More...

List of all members.

Static Public Member Functions

static void BinaryToHexString (const void *in_buffer, simba_unsigned_native in_size, simba_char *out_buffer)
 Converts the given byte buffer into a hex string.
static void GetDefaultTypeName (simba_int16 in_sqlType, simba_wstring &out_typeName)
 Utility function to get the default data type name as a string. Deprecated.
static void HexStringToBinary (const simba_char *in_hexString, simba_unsigned_native in_size, void *out_buffer)
 Converts the given hex string into a byte array.
static bool OutputConvertedStringData (const void *in_value, simba_size_t in_length, EncodingType in_sourceEnc, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given string to given the SqlData object.
static bool OutputVarBinaryData (const void *in_value, simba_size_t in_length, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given binary data to the given the SqlData object.
static bool OutputVarCharStringData (const simba_char *in_value, simba_size_t in_length, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given string to given the SqlData object.
static bool OutputVarCharStringData (const simba_string &in_value, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given string to the given the SqlData object.
static bool OutputVarCharStringData (const simba_string *in_value, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given string to the given the SqlData object.
static bool OutputWVarCharStringData (const simba_wstring &in_value, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given wide string to the SqlData object.
static bool OutputWVarCharStringData (const simba_wstring *in_value, SqlData *io_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Writes the given wide string to the SqlData object.

Protected Member Functions

 DSITypeUtilities ()
 Constructor.

Detailed Description

Provides utilities for handling data types.


Constructor & Destructor Documentation

DSITypeUtilities (  )  [inline, protected]

Constructor.


Member Function Documentation

static void BinaryToHexString ( const void *  in_buffer,
simba_unsigned_native  in_size,
simba_char *  out_buffer 
) [static]

Converts the given byte buffer into a hex string.

The returned hex string will contain two characters in 0-9,A-F for each byte in the input buffer. Thus the caller is responsible for providing an output buffer which is at least twice as large as the input. The output will not be null terminated, and will contain no '0x' prefix.

Parameters:
in_buffer A pointer to the input buffer. Should be of size at least in_size. (NOT OWN)
in_size The amount of bytes to convert to hex.
out_buffer The buffer to write the hex string to. Should be of size at least 2 * in_size. Will not be null terminated. (NOT OWN)
static void GetDefaultTypeName ( simba_int16  in_sqlType,
simba_wstring out_typeName 
) [static]

Utility function to get the default data type name as a string. Deprecated.

Parameters:
in_sqlType The SQL defined data type.
out_typeName The default data type name.
static void HexStringToBinary ( const simba_char *  in_hexString,
simba_unsigned_native  in_size,
void *  out_buffer 
) [static]

Converts the given hex string into a byte array.

The input hex string must contain only the characters in 0-9,A-F,a-f. in_size must be an even number, and since two hex characters represent 1 byte, the output buffer must be at least half the size of the input buffer.

Parameters:
in_hexString A pointer to the input buffer. Should be of size at least in_size. (NOT OWN)
in_size The amount of characters to convert. Must be an even number
out_buffer The buffer to write the converted binary value to. Must be of size at least in_size / 2. (NOT OWN)
static bool OutputConvertedStringData ( const void *  in_value,
simba_size_t  in_length,
EncodingType  in_sourceEnc,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given string to given the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

Parameters:
in_value The string data to write to io_data. (NOT OWN)
in_length The length of in_value in bytes.
in_sourceEnc The encoding of in_value.
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise;
static bool OutputVarBinaryData ( const void *  in_value,
simba_size_t  in_length,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given binary data to the given the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

Parameters:
in_value The binary data to write to io_data. (NOT OWN)
in_length The length of in_value in bytes.
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise;
static bool OutputVarCharStringData ( const simba_char *  in_value,
simba_size_t  in_length,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given string to given the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

Parameters:
in_value The string to write to io_data. Must be in the encoding of io_data. (NOT OWN)
in_length The length of in_value in characters.
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise;
static bool OutputVarCharStringData ( const simba_string &  in_value,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given string to the given the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

Parameters:
in_value The string to write to io_data. Must be in the encoding of io_data.
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise;
static bool OutputVarCharStringData ( const simba_string *  in_value,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given string to the given the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

Parameters:
in_value The string to write to io_data. Must be in the encoding of io_data. (NOT OWN)
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise;
static bool OutputWVarCharStringData ( const simba_wstring in_value,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given wide string to the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

NOTE: This method degenerates into O(n^2) behavior when retrieving a long column in chunks if the encoding of io_data does not match the internal encoding of simba_wstring,where n is the length of the cell being retrieved in chunks in the encoding of io_data.

Parameters:
in_value The wide string to write to io_data.
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise.
static bool OutputWVarCharStringData ( const simba_wstring in_value,
SqlData io_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [static]

Writes the given wide string to the SqlData object.

Must only be used with SqlData that uses TDW_BUFFER_OWNED.

NOTE: This method degenerates into O(n^2) behavior when retrieving a long column in chunks if the encoding of io_data does not match the internal encoding of simba_wstring,where n is the length of the cell being retrieved in chunks in the encoding of io_data.

Parameters:
in_value The wide string to write to io_data. (NOT OWN)
io_data Holds a buffer to write in_value to. (NOT OWN)
in_offset Number of bytes in in_value to skip before copying into in_data.
in_maxSize The max size to write. RETRIEVE_ALL_DATA if all data should be written.
Returns:
True if there is more data left in in_value to write; false otherwise.

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

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