Class: TTextIndex

Declaration: TextTypes.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

One of three simple types (TTextCount, TTextIndex, and TTextOffset) for use when referencing the Unicode characters stored within a TText object. TText, TTextRange, and TInsertionOffset classes depend upon these three types. A TTextIndex is a zero-based index into a TText object that points to the exact position of a character. Zero points to the first character of the TText object, 1 points to the second character of the TText object, and so on. For example, the string abc contains the TTextIndex positions 0, 1, and 2.

Instantiation:

Allocate on the stack.

Deriving Classes:

This is a primitive class that is not designed for deriving. TTextIndex is used pervasively with text and performance is critical.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TTextIndex::GetMaximum

static const TTextIndex & GetMaximum ()

Interface Category:

API.

Purpose:

Gets the maximum possible value for a TTextIndex.

Calling Context:

When you need to know the largest positive value possible for a TTextIndex, you can call this static member function.

Parameters:

Return Value:

A TTextIndex with the largest positive value possible.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator<<=

TStream & operator <<= (TStream & fromStream)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator>>=

TStream & operator >>=(TStream & toStream) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator--

  1. TTextIndex & operator --()
  2. TTextIndex operator --(int)

Interface Category:

API.

Purpose:

  1. Decrement operator.
  2. Decrement operator.

Calling Context:

  1. Call to decrement a TTextIndex by 1.
  2. Call to decrement a TTextIndex by a specific amount.

Parameters:

Return Value:

The decremented text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator++

  1. TTextIndex & operator ++ ()
  2. TTextIndex operator ++ (int)

Interface Category:

API.

Purpose:

  1. Increment operator.
  2. Increment operator.

Calling Context:

  1. Call to increment a TTextIndex by 1.
  2. Call to increment a TTextIndex by a specific amount.

Parameters:

Return Value:

The incremented text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator%=

TTextIndex & operator %= (long that)

Interface Category:

API.

Purpose:

Performs modulus division on the text index and assigns the result to the text index.

Calling Context:

Call to perform modulus division and assign the result to the text index.

Parameters:

Return Value:

The new value of the text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator/=

TTextIndex & operator /= (long that)

Interface Category:

API.

Purpose:

Performs division on the text index and assigns the result to the text index.

Calling Context:

Call to perform division on the text index and assign the result to the text index.

Parameters:

Return Value:

The new value of the text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator*=

TTextIndex & operator *= (long that)

Interface Category:

API.

Purpose:

Performs multiplication on the text index and assigns the result to the text index.

Calling Context:

Call to perform multiplication on the text index and assign the result to the text index.

Parameters:

Return Value:

The new value of the text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator-=

TTextIndex & operator -=(long that)

Interface Category:

API.

Purpose:

Performs subtraction on the text index and assigns the result to the text index.

Calling Context:

Call to perform subtraction on the text index and assign the result to the text index.

Parameters:

Return Value:

The new value of the text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator+=

TTextIndex & operator += (long that)

Interface Category:

API.

Purpose:

Performs addition on the text index and assigns the result to the text indexes.

Calling Context:

Call to perform addition on the text index and assign the result to the text index.

Parameters:

Return Value:

The new value of the text index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operator=

TTextIndex & operator =(const TTextIndex & that)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::TTextIndex

  1. TTextIndex ()
  2. TTextIndex (long that)
  3. TTextIndex (const TTextIndex & that)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs a TTextIndex defining the specified position.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Call to construct a TTextIndex defining a specific position.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextIndex::operatorlong

operator long () const

Interface Category:

API.

Purpose:

Converts the TTextIndex into a long value.

Calling Context:

Called to convert the TTextIndex into a long value.

Parameters:

Return Value:

Implicitly int.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.