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 TTextOffset is an offset relative to some point and can be positive or negative. Offsets are typically from the beginning of a string. Conceptually, a TTextOffset points to the position between two characters in a text object. Zero points to the position before the first character of a TText object, 1 points to the position between the first character and the second character of a TText object, and so on.
For example, the string abc contains the TTextOffset positions 0, 1, 2, and 3.
Instantiation:
Allocate on the stack.
Deriving Classes:
This is a primitive class that is not designed for deriving. TTextOffsets are used pervasively with text and performance is critical.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Member Function: TTextOffset::GetMaximum
static const TTextOffset & GetMaximum ()
Interface Category:
API.
Purpose:
Gets the maximum possible value for a TTextOffset.
Calling Context:
When you need to know the largest positive value possible for a TTextOffset you can call this static member function.
Parameters:
Return Value:
A TTextOffset with the largest positive value possible.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator<<=
TStream & operator <<= (TStream & fromStream)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromStream -The stream the object streams itself in from.
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: TTextOffset::operator>>=
TStream & operator >>=(TStream & toStream) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toStream -The stream the object streams itself out to.
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: TTextOffset::operator--
- TTextOffset & operator --()
- TTextOffset operator --(int)
Interface Category:
API.
Purpose:
- Decrement operator.
- Decrement operator.
Calling Context:
- Call to decrement a TTextOffset by 1.
- Call to decrement a TTextOffset by a specific amount.
Parameters:
- Takes no parameters.
- int -The number by which to decrement the text offset.
Return Value:
The decremented text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator++
- TTextOffset & operator ++ ()
- TTextOffset operator ++ (int)
Interface Category:
API.
Purpose:
- Increment operator.
- Increment operator.
Calling Context:
- Call to increment a TTextOffset by 1.
- Call to increment a TTextOffset by a specific amount.
Parameters:
- Takes no parameters.
- int -The number by which to increment the text offset.
Return Value:
The incremented text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator%=
TTextOffset & operator %= (long that)
Interface Category:
API.
Purpose:
Performs modulus division on the text offset and assigns the result to the text offset.
Calling Context:
Call to perform modulus division and assign the result to the text offset.
Parameters:
- long that -The number by which to divide the text offset.
Return Value:
The new value of the text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator/=
TTextOffset & operator /= (long that)
Interface Category:
API.
Purpose:
Performs division on the text offset and assigns the result to the text offset.
Calling Context:
Call to perform division on the text offset and assign the result to the text offset.
Parameters:
- long that -The number by which to divide the text offset.
Return Value:
The new value of the text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator*=
TTextOffset & operator *= (long that)
Interface Category:
API.
Purpose:
Performs multiplication on the text offset and assigns the result to the text offset.
Calling Context:
Call to perform multiplication on the text offset and assign the result to the text offset.
Parameters:
- long that -The number by which to multiply the text offset.
Return Value:
The new value of the text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator-=
TTextOffset & operator -=(long that)
Interface Category:
API.
Purpose:
Performs subtraction on the text offset and assigns the result to the text offset.
Calling Context:
Call to perform subtraction on the text offset and assign the result to the text offset.
Parameters:
- long that -The number to subtract from the text offset.
Return Value:
The new value of the text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator+=
TTextOffset & operator += (long that)
Interface Category:
API.
Purpose:
Performs addition on the text offset and assigns the result to the text index.
Calling Context:
Call to perform addition on the text offset and assign the result to the text offset.
Parameters:
- long that -The number to add to the text offset.
Return Value:
The new value of the text offset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTextOffset::operator=
TTextOffset & operator =(const TTextOffset & that)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TTextOffset & that -The source object for the assignment.
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.
- TTextOffset ()
- TTextOffset (long that)
- TTextOffset (const TTextOffset & that)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructs a TTextOffset of a particular length.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called to construct a TTextOffset of a particular length.
- 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: TTextOffset::operatorlong
operator long () const
Interface Category:
API.
Purpose:
Converts the TTextOffset into a long value.
Calling Context:
Called to convert the TTextOffset 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.