IODBCStringConverter Class Reference

An interface that supports conversion between simba_wstrings and ODBC SQLCHAR and SQLWCHAR buffers. More...

List of all members.

Public Member Functions

virtual void ConvertSQLCHARCharsToWString (const SQLCHAR *in_source, simba_int32 in_length, bool in_isLengthInBytes, simba_wstring &io_dest)=0
 Converts in_source (which is of length in_length) into io_dest.
virtual void ConvertSQLWCHARCharsToWString (const simba_byte *in_source, simba_int32 in_length, bool in_isLengthInBytes, simba_wstring &io_dest)=0
 Converts in_source (which is of length in_length) into io_dest.
virtual simba_int32 ConvertWStringToSQLWCHARString (const simba_wstring &in_source, simba_byte *out_dest, simba_int32 in_length, bool in_isLengthInBytes, bool &out_truncated)=0
 Converts in_source into the out_dest buffer.
virtual simba_int32 GetLengthAsSQLWCHARString (const simba_wstring &in_source, bool in_isLengthInBytes)=0
 Returns the number of bytes or characters that in_source will take up in the DriverManagerEncoding, NOT including a NUL terminator.
virtual simba_int32 GetSQLCHARToSQLWCHARMaxBufferLength (const SQLCHAR *in_string, simba_int32 in_length, bool in_isLengthInBytes, bool in_isInput)=0
 Returns the maximum buffer size, in number of DriverManagerEncoding code units, when converting a string from AnsiAppEncoding to DriverManagerEncoding.
virtual ~IODBCStringConverter ()
 Destructor.

Protected Member Functions

 IODBCStringConverter ()
 Constructor.

Detailed Description

An interface that supports conversion between simba_wstrings and ODBC SQLCHAR and SQLWCHAR buffers.


Constructor & Destructor Documentation

virtual ~IODBCStringConverter (  )  [inline, virtual]

Destructor.

IODBCStringConverter (  )  [inline, protected]

Constructor.


Member Function Documentation

virtual void ConvertSQLCHARCharsToWString ( const SQLCHAR *  in_source,
simba_int32  in_length,
bool  in_isLengthInBytes,
simba_wstring io_dest 
) [pure virtual]

Converts in_source (which is of length in_length) into io_dest.

Parameters:
in_source The source text. This is in the AnsiAppEncoding. (NOT OWN).
in_length Length of in_source, or SIMBA_NTS if in_source is NUL-terminated. In bytes if in_isLengthInBytes, otherwise in # of SQLCHAR units.
in_isLengthInBytes Indicates if the length is in bytes or in AnsiAppEncoding code units.
io_dest The output simba_wstring to hold the result.
virtual void ConvertSQLWCHARCharsToWString ( const simba_byte in_source,
simba_int32  in_length,
bool  in_isLengthInBytes,
simba_wstring io_dest 
) [pure virtual]

Converts in_source (which is of length in_length) into io_dest.

Parameters:
in_source The source text. This should be text in the same encoding as the DriverManagerEncoding. This is usually a SQLWCHAR pointer. (NOT OWN).
in_length Length of in_source, or SIMBA_NTS if in_source is NUL-terminated. In bytes if in_isLengthInBytes, otherwise in # of SQLWCHAR units.
in_isLengthInBytes Indicates if the length is in bytes.
io_dest The output simba_wstring to hold the result.
virtual simba_int32 ConvertWStringToSQLWCHARString ( const simba_wstring in_source,
simba_byte out_dest,
simba_int32  in_length,
bool  in_isLengthInBytes,
bool &  out_truncated 
) [pure virtual]

Converts in_source into the out_dest buffer.

This makes use of the Driver Manager's encoding for SQLWCHAR*. Includes a NUL terminator. out_truncated is set to indicate whether or not truncation occurred.

Returns the number of code units actually written. In bytes if in_isLengthInBytes, or in DriverManagerEncoding code units otherwise.

Parameters:
in_source The source text.
out_dest An output buffer to write the result to. (NOT OWN).
in_length Length of the out_dest buffer. In bytes if in_isLengthInBytes, otherwise in # of DriverManagerEncoding code units.
in_isLengthInBytes Indicates if in_length is in terms of bytes or if it's in terms of DriverManagerEncoding code units.
out_truncated Indicates if truncation occurred.
Returns:
the number of code units actually written. In bytes if in_isLengthInBytes, or in DriverManagerEncoding code units otherwise.
virtual simba_int32 GetLengthAsSQLWCHARString ( const simba_wstring in_source,
bool  in_isLengthInBytes 
) [pure virtual]

Returns the number of bytes or characters that in_source will take up in the DriverManagerEncoding, NOT including a NUL terminator.

Parameters:
in_source The text.
in_isLengthInBytes If true, the returned value is in bytes. Otherwise, it is in DriverManagerEncoding code units.
Returns:
the number of bytes or characters that in_source will take up in the DriverManagerEncoding, NOT including a NUL terminator.
virtual simba_int32 GetSQLCHARToSQLWCHARMaxBufferLength ( const SQLCHAR *  in_string,
simba_int32  in_length,
bool  in_isLengthInBytes,
bool  in_isInput 
) [pure virtual]

Returns the maximum buffer size, in number of DriverManagerEncoding code units, when converting a string from AnsiAppEncoding to DriverManagerEncoding.

in_string will be used to determine the string length if in_length is SQL_NTS.

Parameters:
in_string The input text, in the AnsiAppEncoding. (NOT OWN).
in_length The length.
in_isLengthInBytes If true, in_length and the returned value is in bytes. Otherwise, both are in SQLWCHAR code units.
in_isInput If true, we should include room for a NUL in the output buffer length when in_length = SQL_NTS.
Returns:
the maximum buffer size, in number of DriverManagerEncoding units, when converting in_string from AnsiAppEncoding to DriverManagerEncoding.

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