Basic text classes

The basic text classes provide the building blocks for all instances of text data in the CommonPoint application system. They allow you to store and manipulate text data, and provide the basis for the interactive text features provided by the Text Editing framework.

Text data consists, at the lowest level, of sequences of Unicode characters. The Unicode character encoding system is described in Chapter 2, "Character representation." The basic text classes allow you to create, store, and manipulate character strings, and apply style information to them.

The CommonPoint application system lets you use styled text throughout the system and provides a large set of character and paragraph styling classes, including style classes that describe font attributes. The CommonPoint application system also provides a default storage mechanism for styled text data. You create TStandardText instances that maintain an array of Unicode characters along with the style information for each character. You can use this mechanism for a wide variety of needs, from small strings to long text data segments, and for styled or unstyled text. You can also perform any of the string functions you expect to perform on character strings. See "String function mappings" on page 52 for a comparison of CommonPoint string functions and ANSI C string functions.

For storing and manipulating character strings that you do not need to style or display, you can use either the token mechanism or the class TSimpleUnicodeArray. TToken allows you to create a fast string that is constant and can be shared. TSimpleUnicodeArray allows you to create a string that cannot be shared but can be edited programmatically and has no dependencies except for storage and streaming. Information on using these classes is in "Encapsulating simple character strings" on page 59.

Referencing positions and ranges in a character string
Creating and managing styled text
String function mappings
Iterating through text data
Encapsulating simple character strings
Deriving your own text and style classes

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker