StringConvertingPartialRetrievalHelper< GetDataFn > Class Template Reference

A helper for retrieving char in parts when a conversion is needed due to a mismatch between source and target encodings. More...

List of all members.

Public Member Functions

simba_uint64 GetCurrentOutputOffset () const
 Get the current output offset. This is the number of bytes which have been returned since the last call to Reset (Unless someone modified it with Seek()).
void Reset ()
 Reset this object so it can be used to convert another string.
void RetrieveAllData (SqlData &in_data)
 Retrieve all remaining data from the current cell.
bool RetrieveData (SqlData *in_data, simba_signed_native in_maxSize)
 Fills in in_data with a chunk of data in the current row.
void Seek (simba_uint64 in_outputOffset)
 Change the current output offset (change where from within the current cell RetrieveData() will start returning from).
 StringConvertingPartialRetrievalHelper (const GetDataFn &in_getDataFn, EncodingType in_fromType, EncodingType in_toType)
 Constructor.

Detailed Description

template<typename GetDataFn>
class Simba::Support::StringConvertingPartialRetrievalHelper< GetDataFn >

A helper for retrieving char in parts when a conversion is needed due to a mismatch between source and target encodings.

Assumptions: -When used in IResult.RetrieveData(), parts will be retrieved in sequential order. Because of this, the offset parameter passed into RetrieveData() can safely be ignored, and managed internally by this class.

GetDataFn A function object similar to IResult.RetrieveData(), except that its prototype is: bool GetDataFn( void* in_targetBuff, simba_signed_native in_buffLen, bool& out_isNull, simba_signed_native& out_bytesCopied, simba_signed_native in_offset);

and it copies the raw bytes of the source string into in_targetBuff. This will be used to get the raw bytes which will be converted.


Constructor & Destructor Documentation

StringConvertingPartialRetrievalHelper ( const GetDataFn &  in_getDataFn,
EncodingType  in_fromType,
EncodingType  in_toType 
) [inline, explicit]

Constructor.

Parameters:
in_getDataFn 
in_fromType 
in_toType 

Member Function Documentation

simba_uint64 GetCurrentOutputOffset (  )  const [inline]

Get the current output offset. This is the number of bytes which have been returned since the last call to Reset (Unless someone modified it with Seek()).

void Reset (  )  [inline]

Reset this object so it can be used to convert another string.

void RetrieveAllData ( SqlData in_data  )  [inline]

Retrieve all remaining data from the current cell.

bool RetrieveData ( SqlData in_data,
simba_signed_native  in_maxSize 
) [inline]

Fills in in_data with a chunk of data in the current row.

Retrieves data sequentially from the source using m_getDataFn.

Parameters:
in_data Holds a buffer to store the requested data. (NOT OWN)
in_maxSize Maximum number of bytes of data to return in in_data. Must NOT be RETRIEVE_ALL_DATA.
Returns:
True if there is more data; false otherwise.
void Seek ( simba_uint64  in_outputOffset  )  [inline]

Change the current output offset (change where from within the current cell RetrieveData() will start returning from).

Parameters:
in_outputOffset The new output offset. May be larger than the actual size of the cell.

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