CSmsBufferSegmenter Class Reference

class CSmsBufferSegmenter : public CBase

Segments unpacked data from a CsmsBufferBase

Inherits from

Constructor & Destructor Documentation

CSmsBufferSegmenter(CSmsAlphabetConverter &, const CSmsBufferBase &, TInt)

CSmsBufferSegmenter ( CSmsAlphabetConverter & aAlphabetConverter,
const CSmsBufferBase & aBuffer,
TInt aSegmentSize
) [protected]

Parameters

CSmsAlphabetConverter & aAlphabetConverter
const CSmsBufferBase & aBuffer
TInt aSegmentSize

~CSmsBufferSegmenter()

IMPORT_C ~CSmsBufferSegmenter ( )

Destructor - Free resource

capability
None

Member Functions Documentation

CheckConvertedBufferAllocL(TInt)

void CheckConvertedBufferAllocL ( TInt aMaxLength ) [protected]

Ensures the segmentation buffer is of the specified length

Parameters

TInt aMaxLength

ConstructL()

void ConstructL ( ) [protected]

2nd phase of constructor. Esures we have an initial buffer.

DoSegmentNextL(TDes8 &, TInt, TInt &, TInt &, TSmsEncoding)

TBool DoSegmentNextL ( TDes8 & aSegmentBuffer,
TInt aSegmentSize,
TInt & aUnconvertedChars,
TInt & aDowngradedChars,
TSmsEncoding aEncoding
) [protected, virtual]

Parameters

TDes8 & aSegmentBuffer
TInt aSegmentSize
TInt & aUnconvertedChars
TInt & aDowngradedChars
TSmsEncoding aEncoding

ElementsToReturnFromConvertedBufferL(TInt)

TInt ElementsToReturnFromConvertedBufferL ( TInt aSegmentSize ) [protected]

Determines the number of converted elements that should be returned in the segment - called from DoSegmentNextL

Parameters

TInt aSegmentSize

FindBestAlternativeEncodingL(TSmsEncoding, TInt)

TSmsEncoding FindBestAlternativeEncodingL ( TSmsEncoding aSuggestedEncoding,
TInt aMaxBodyLength
) const

Parameters

TSmsEncoding aSuggestedEncoding
TInt aMaxBodyLength

MoreL()

TBool MoreL ( )

NewLC(CSmsAlphabetConverter &, const CSmsBufferBase &, TInt)

IMPORT_C CSmsBufferSegmenter * NewLC ( CSmsAlphabetConverter & aAlphabetConverter,
const CSmsBufferBase & aBuffer,
TInt aSegmentSize = 0
) [static]

This factory function creates a CsmsBufferSegmenter instance

capability
None

Parameters

CSmsAlphabetConverter & aAlphabetConverter Pre-configured
const CSmsBufferBase & aBuffer The message data
TInt aSegmentSize = 0 (Default = 0) The size of segment required. If the instance is to be used solely for determining the total length of the converted data with TotalConvertedLengthL() then the segment length need not be supplied, hence defaulting to zero.

Reset()

void Reset ( )

Resets the converted buffer

SegmentNextL(TDes8 &, TInt &, TInt &, TSmsEncoding)

IMPORT_C TBool SegmentNextL ( TDes8 & aSegmentBuffer,
TInt & aUnconvertedChars,
TInt & aDowngradedChars,
TSmsEncoding aEncoding
)

A client iteratively calls SegmentNextL() to retrieve each segment until ETrue is returned, indicating that the last segment has been reached. The output buffer, aSegmentBuffer, should be large enough to hold the number of elements specified by the segment size in the NewLC() constructor otherwise the call will Panic. The output buffer is automatically reset before it's filled.

capability
None

Parameters

TDes8 & aSegmentBuffer The next segment
TInt & aUnconvertedChars
TInt & aDowngradedChars
TSmsEncoding aEncoding

TotalConvertedLengthL(TSmsEncoding)

IMPORT_C TInt TotalConvertedLengthL ( TSmsEncoding aEncoding )

TotalConvertedLengthL() determines the total length in User Data Elements when the input buffer is converted. Depending on the conversion properties returned from the alphabet converter, a complete conversion may need to be performed, i.e. this call can be quite expensive.

capability
None

Parameters

TSmsEncoding aEncoding

Member Data Documentation

CSmsAlphabetConverter & iAlphabetConverter

CSmsAlphabetConverter & iAlphabetConverter [protected]

HBufC8 * iConvertedBuffer

HBufC8 * iConvertedBuffer [protected]

TPtr8 iConvertedBufferPtr

TPtr8 iConvertedBufferPtr [protected]

TInt iElementsExtracted

TInt iElementsExtracted [protected]

TInt iSegmentSize

TInt iSegmentSize [protected]

const CSmsBufferBase & iSmsBuffer

const CSmsBufferBase & iSmsBuffer [protected]