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,
TIntaSegmentSize
)[protected]

Parameters

CSmsAlphabetConverter & aAlphabetConverter
const CSmsBufferBase & aBuffer
TInt aSegmentSize

~CSmsBufferSegmenter()

IMPORT_C~CSmsBufferSegmenter()

Destructor - Free resource

capability
None

Member Functions Documentation

CheckConvertedBufferAllocL(TInt)

voidCheckConvertedBufferAllocL(TIntaMaxLength)[protected]

Ensures the segmentation buffer is of the specified length

Parameters

TInt aMaxLength

ConstructL()

voidConstructL()[protected]

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

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

TBool DoSegmentNextL(TDes8 &aSegmentBuffer,
TIntaSegmentSize,
TInt &aUnconvertedChars,
TInt &aDowngradedChars,
TSmsEncodingaEncoding
)[protected, virtual]

Parameters

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

ElementsToReturnFromConvertedBufferL(TInt)

TInt ElementsToReturnFromConvertedBufferL(TIntaSegmentSize)[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(TSmsEncodingaSuggestedEncoding,
TIntaMaxBodyLength
)const

Parameters

TSmsEncoding aSuggestedEncoding
TInt aMaxBodyLength

MoreL()

TBool MoreL()

NewLC(CSmsAlphabetConverter &, const CSmsBufferBase &, TInt)

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

This factory function creates a CsmsBufferSegmenter instance

capability
None

Parameters

CSmsAlphabetConverter & aAlphabetConverterPre-configured
const CSmsBufferBase & aBufferThe 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()

voidReset()

Resets the converted buffer

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

IMPORT_C TBoolSegmentNextL(TDes8 &aSegmentBuffer,
TInt &aUnconvertedChars,
TInt &aDowngradedChars,
TSmsEncodingaEncoding
)

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 & aSegmentBufferThe next segment
TInt & aUnconvertedChars
TInt & aDowngradedChars
TSmsEncoding aEncoding

TotalConvertedLengthL(TSmsEncoding)

IMPORT_C TIntTotalConvertedLengthL(TSmsEncodingaEncoding)

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]