CFragmentedString Class Reference

class CFragmentedString : protected CArrayPtrFlat< HBufC >

Utility that allows a single string to be built from an array of consecutive sub-strings.

The sub-strings can be inserted by reference or copied.

The object maintains information that points to a current position within the string. A typical use is to test the contents of the string using one of the Match...() functions, and then use ConsumeMatched() to advance past the matched area.

The class also supports inserting an unlimited number of marks in the string, and performing operations relative to the head (i.e. last inserted) mark.

Nested Classes and Structures

Public Member Functions
CFragmentedString()
~CFragmentedString()
IMPORT_C voidAddStringL(HBufC *)
IMPORT_C voidAddStringL(const TDesC &)
IMPORT_C voidConsumeMatched()
IMPORT_C HBufC *ContentL()
IMPORT_C voidDeleteMark()
IMPORT_C voidInsertStringL(HBufC *)
IMPORT_C TIntLength()
IMPORT_C voidMark()
IMPORT_C HBufC *MarkedL()
IMPORT_C HBufC *MarkedWithInitialTextL(const TDesC &)
IMPORT_C TStringMatchMatch(const TDesC &)
IMPORT_C TStringMatchMatchNotSelect(const TDesC &)
IMPORT_C TStringMatchMatchRange(const TUint, const TUint)
IMPORT_C TStringMatchMatchSelect(const TDesC &)
IMPORT_C voidReplaceMarkedAndSkipL(HBufC *)
IMPORT_C voidReplaceMarkedL(HBufC *)
IMPORT_C voidReset()
IMPORT_C voidResetToMark()
IMPORT_C HBufC *StringL()
Protected Member Functions
IMPORT_C voidDeleteToMark(const TStringMark &)
CFragmentedString::TStringMatch DoMatchSelect(const TDesC &, TBool)
TBool FindNextMatchChar(TUint &)
IMPORT_C voidInsertStringToL(HBufC *, TInt, TInt)
voidStartMatch()
HBufC *StringL(TInt, TInt, TInt, TInt, const TDesC *)
Inherited Functions
CArrayFix< HBufC * >::AppendL(const HBufC *&)
CArrayFix< HBufC * >::AppendL(const HBufC *&,TInt)
CArrayFix< HBufC * >::AppendL(const HBufC **,TInt)
CArrayFix< HBufC * >::Array()const
CArrayFix< HBufC * >::At(TInt)
CArrayFix< HBufC * >::At(TInt)const
CArrayFix< HBufC * >::Back(TInt)
CArrayFix< HBufC * >::Back(TInt)const
CArrayFix< HBufC * >::CArrayFix(TBufRep,TInt)
CArrayFix< HBufC * >::End(TInt)
CArrayFix< HBufC * >::End(TInt)const
CArrayFix< HBufC * >::ExpandL(TInt)
CArrayFix< HBufC * >::ExtendL()
CArrayFix< HBufC * >::Find(const HBufC *&,TKeyArrayFix &,TInt &)const
CArrayFix< HBufC * >::FindIsq(const HBufC *&,TKeyArrayFix &,TInt &)const
CArrayFix< HBufC * >::InsertIsqAllowDuplicatesL(const HBufC *&,TKeyArrayFix &)
CArrayFix< HBufC * >::InsertIsqL(const HBufC *&,TKeyArrayFix &)
CArrayFix< HBufC * >::InsertL(TInt,const HBufC *&)
CArrayFix< HBufC * >::InsertL(TInt,const HBufC *&,TInt)
CArrayFix< HBufC * >::InsertL(TInt,const HBufC **,TInt)
CArrayFix< HBufC * >::ResizeL(TInt)
CArrayFix< HBufC * >::ResizeL(TInt,const HBufC *&)
CArrayFix< HBufC * >::operator[](TInt)
CArrayFix< HBufC * >::operator[](TInt)const
CArrayFixBase::AtR(const CBase *,TInt)
CArrayFixBase::CArrayFixBase(TBufRep,TInt,TInt)
CArrayFixBase::Compress()
CArrayFixBase::Count()const
CArrayFixBase::CountR(const CBase *)
CArrayFixBase::Delete(TInt)
CArrayFixBase::Delete(TInt,TInt)
CArrayFixBase::Find(const TAny *,TKeyArrayFix &,TInt &)const
CArrayFixBase::FindIsq(const TAny *,TKeyArrayFix &,TInt &)const
CArrayFixBase::InsertIsqAllowDuplicatesL(const TAny *,TKeyArrayFix &)
CArrayFixBase::InsertIsqL(const TAny *,TKeyArrayFix &)
CArrayFixBase::InsertL(TInt,const TAny *)
CArrayFixBase::InsertL(TInt,const TAny *,TInt)
CArrayFixBase::InsertRepL(TInt,const TAny *,TInt)
CArrayFixBase::ResizeL(TInt,const TAny *)
CArrayFixBase::SetKey(TKeyArrayFix &)const
CArrayFixBase::SetReserveFlatL(TInt)
CArrayFixBase::Sort(TKeyArrayFix &)
CArrayFixBase::~CArrayFixBase()
CArrayPtr< HBufC >::CArrayPtr(TBufRep,TInt)
CArrayPtr< HBufC >::ResetAndDestroy()
CArrayPtrFlat< HBufC >::CArrayPtrFlat(TInt)
CArrayPtrFlat< HBufC >::SetReserveL(TInt)
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTStringMatch { ENoMatch, EMatch, EInsufficientData }
Protected Member Type Definitions
typedef CStack< TStringMark, ETrue > CMarkStack
Protected Attributes
TInt iCurrentCharacter
TInt iCurrentIndex
CMarkStack iMarkStack
TStringMatch iMatched
TInt iMatchedToCharacter
TInt iMatchedToIndex

Constructor & Destructor Documentation

CFragmentedString()

IMPORT_CCFragmentedString()

~CFragmentedString()

IMPORT_C~CFragmentedString()

Member Functions Documentation

AddStringL(HBufC *)

IMPORT_C voidAddStringL(HBufC *aString)

Parameters

HBufC * aString

AddStringL(const TDesC &)

IMPORT_C voidAddStringL(const TDesC &aString)

Parameters

const TDesC & aString

ConsumeMatched()

IMPORT_C voidConsumeMatched()

ContentL()

IMPORT_C HBufC *ContentL()const

DeleteMark()

IMPORT_C voidDeleteMark()

DeleteToMark(const TStringMark &)

IMPORT_C voidDeleteToMark(const TStringMark &aStringMark)[protected]

Parameters

const TStringMark & aStringMark

DoMatchSelect(const TDesC &, TBool)

CFragmentedString::TStringMatch DoMatchSelect(const TDesC &aSelection,
TBoolaInSelection
)[protected]

Parameters

const TDesC & aSelection
TBool aInSelection

FindNextMatchChar(TUint &)

TBool FindNextMatchChar(TUint &aChar)[protected]

Parameters

TUint & aChar

InsertStringL(HBufC *)

IMPORT_C voidInsertStringL(HBufC *aString)

Parameters

HBufC * aString

InsertStringToL(HBufC *, TInt, TInt)

IMPORT_C voidInsertStringToL(HBufC *aString,
TIntaStringIndex,
TIntaLengthIntoString
)[protected]

Parameters

HBufC * aString
TInt aStringIndex
TInt aLengthIntoString

Length()

IMPORT_C TIntLength()const

Gets the length of an element.

The length of an element of type class T.

Mark()

IMPORT_C voidMark()

MarkedL()

IMPORT_C HBufC *MarkedL()

MarkedWithInitialTextL(const TDesC &)

IMPORT_C HBufC *MarkedWithInitialTextL(const TDesC &aInitialText)

Parameters

const TDesC & aInitialText

Match(const TDesC &)

IMPORT_C TStringMatchMatch(const TDesC &aString)

Parameters

const TDesC & aString

MatchNotSelect(const TDesC &)

IMPORT_C TStringMatchMatchNotSelect(const TDesC &aSelection)

Parameters

const TDesC & aSelection

MatchRange(const TUint, const TUint)

IMPORT_C TStringMatchMatchRange(const TUintaLower,
const TUintaUpper
)

Parameters

const TUint aLower
const TUint aUpper

MatchSelect(const TDesC &)

IMPORT_C TStringMatchMatchSelect(const TDesC &aSelection)

Parameters

const TDesC & aSelection

ReplaceMarkedAndSkipL(HBufC *)

IMPORT_C voidReplaceMarkedAndSkipL(HBufC *aString)

Parameters

HBufC * aString

ReplaceMarkedL(HBufC *)

IMPORT_C voidReplaceMarkedL(HBufC *aString)

Parameters

HBufC * aString

Reset()

IMPORT_C voidReset()

ResetToMark()

IMPORT_C voidResetToMark()

StartMatch()

voidStartMatch()[protected]

StringL()

IMPORT_C HBufC *StringL()const

StringL(TInt, TInt, TInt, TInt, const TDesC *)

HBufC *StringL(TIntaStartIndex,
TIntaStartCharacter,
TIntaEndIndex,
TIntaEndCharacter,
const TDesC *aInitialText = NULL
)const [protected]

Parameters

TInt aStartIndex
TInt aStartCharacter
TInt aEndIndex
TInt aEndCharacter
const TDesC * aInitialText = NULL

Member Enumerations Documentation

Enum TStringMatch

Defines possible results of a string matching operation for this class.

Enumerators

ENoMatch

There was no match.

EMatch

There was a complete match.

EInsufficientData

String contained insufficient data to perform the match operation.

This can mean that the start of the target string was matched, but the string being searched ended before a complete match was found.

Member Type Definitions Documentation

Typedef CMarkStack

typedef CStack< TStringMark, ETrue >CMarkStack[protected]

A stack of string position marks.

Member Data Documentation

TInt iCurrentCharacter

TInt iCurrentCharacter[protected]

Current character position within the current sub-string.

TInt iCurrentIndex

TInt iCurrentIndex[protected]

Array index of the current sub-string.

CMarkStack iMarkStack

CMarkStack iMarkStack[protected]

Stack of marks in the string.

Mark() pushes a mark on the stack; DeleteMark() pops one off.

TStringMatch iMatched

TStringMatch iMatched[protected]

Result of the last match operation.

TInt iMatchedToCharacter

TInt iMatchedToCharacter[protected]

Current character position within the iMatchedToIndex sub-string found in the last match operation.

TInt iMatchedToIndex

TInt iMatchedToIndex[protected]

Array index of the sub-string found in the last match operation.