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.
Public Member Functions | |
---|---|
CFragmentedString() | |
~CFragmentedString() | |
IMPORT_C void | AddStringL(HBufC *) |
IMPORT_C void | AddStringL(const TDesC &) |
IMPORT_C void | ConsumeMatched() |
IMPORT_C HBufC * | ContentL() |
IMPORT_C void | DeleteMark() |
IMPORT_C void | InsertStringL(HBufC *) |
IMPORT_C TInt | Length() |
IMPORT_C void | Mark() |
IMPORT_C HBufC * | MarkedL() |
IMPORT_C HBufC * | MarkedWithInitialTextL(const TDesC &) |
IMPORT_C TStringMatch | Match(const TDesC &) |
IMPORT_C TStringMatch | MatchNotSelect(const TDesC &) |
IMPORT_C TStringMatch | MatchRange(const TUint, const TUint) |
IMPORT_C TStringMatch | MatchSelect(const TDesC &) |
IMPORT_C void | ReplaceMarkedAndSkipL(HBufC *) |
IMPORT_C void | ReplaceMarkedL(HBufC *) |
IMPORT_C void | Reset() |
IMPORT_C void | ResetToMark() |
IMPORT_C HBufC * | StringL() |
Protected Member Functions | |
---|---|
IMPORT_C void | DeleteToMark(const TStringMark &) |
CFragmentedString::TStringMatch | DoMatchSelect(const TDesC &, TBool) |
TBool | FindNextMatchChar(TUint &) |
IMPORT_C void | InsertStringToL(HBufC *, TInt, TInt) |
void | StartMatch() |
HBufC * | StringL(TInt, TInt, TInt, TInt, const TDesC *) |
Public Member Enumerations | |
---|---|
enum | TStringMatch { 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 |
IMPORT_C void | AddStringL | ( | const TDesC & | aString | ) |
const TDesC & aString |
IMPORT_C void | DeleteToMark | ( | const TStringMark & | aStringMark | ) | [protected] |
const TStringMark & aStringMark |
CFragmentedString::TStringMatch | DoMatchSelect | ( | const TDesC & | aSelection, |
TBool | aInSelection | |||
) | [protected] |
IMPORT_C void | InsertStringToL | ( | HBufC * | aString, |
TInt | aStringIndex, | |||
TInt | aLengthIntoString | |||
) | [protected] |
IMPORT_C TInt | Length | ( | ) | const |
Gets the length of an element.
The length of an element of type class T.
IMPORT_C HBufC * | MarkedWithInitialTextL | ( | const TDesC & | aInitialText | ) |
const TDesC & aInitialText |
IMPORT_C TStringMatch | Match | ( | const TDesC & | aString | ) |
const TDesC & aString |
IMPORT_C TStringMatch | MatchNotSelect | ( | const TDesC & | aSelection | ) |
const TDesC & aSelection |
IMPORT_C TStringMatch | MatchRange | ( | const TUint | aLower, |
const TUint | aUpper | |||
) |
IMPORT_C TStringMatch | MatchSelect | ( | const TDesC & | aSelection | ) |
const TDesC & aSelection |
IMPORT_C void | ReplaceMarkedAndSkipL | ( | HBufC * | aString | ) |
HBufC * aString |
HBufC * | StringL | ( | TInt | aStartIndex, |
TInt | aStartCharacter, | |||
TInt | aEndIndex, | |||
TInt | aEndCharacter, | |||
const TDesC * | aInitialText = NULL | |||
) | const [protected] |
Defines possible results of a string matching operation for this class.
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. |
typedef CStack< TStringMark, ETrue > | CMarkStack | [protected] |
A stack of string position marks.
TInt | iCurrentCharacter | [protected] |
Current character position within the current sub-string.
CMarkStack | iMarkStack | [protected] |
Stack of marks in the string.
Mark() pushes a mark on the stack; DeleteMark() pops one off.
TInt | iMatchedToCharacter | [protected] |
Current character position within the iMatchedToIndex sub-string found in the last match operation.
TInt | iMatchedToIndex | [protected] |
Array index of the sub-string found in the last match operation.