Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Text objects

Four classes provide increasing levels of support for text content:

A text object has any number of characters, and always ends with a paragraph mark, which is not included in the length. The shortest document contains zero characters. The characters in a text object are contained in a dynamic buffer, usually a CBufSeg but, for short text objects of bounded length, a CBufFlat may be more appropriate.


Manipulating text objects

Text objects provide functions to insert and delete text, and to exchange text with descriptors. Definitions for special characters are also provided.

Facilities to count characters, words and paragraphs are provided, and also to find the beginning of the next or previous word or paragraph. When scanning words, various types of delimiters may be used. For example picture characters and punctuation delimiters may be set, which is useful for spell checking. Delimeters, such as EScanPictureIsDelimiter, are set in a scan mask parameter to the ScanWords() functions of the CEditableText and CPlainText classes.

[Top]


Addressable document positions

Characters are addressed by a document position, which may range from zero through to the length of the buffer. A document position is considered to mark the point between two adjacent characters. Thus document position 2 is located between the second and third characters. Document position 0 is located before the first character in the text object. Inserting text at position 5 will insert text immediately after the fifth character. Special elements such as paragraph marks, non-breaking spaces etc. are assigned to their Unicode character codes.