Back to index

lightning-sunbird  0.9+nobinonly
Public Types
nsTAString_CharT Class Reference

nsTAString is the most abstract class in the string hierarchy. More...

#include <nsTAString.h>

Inheritance diagram for nsTAString_CharT:
Inheritance graph
[legend]

List of all members.

Public Types

typedef CharT char_type
typedef nsCharTraits< char_typechar_traits
typedef
char_traits::incompatible_char_type 
incompatible_char_type
typedef nsTAString_CharT self_type
typedef nsTAString_CharT abstract_string_type
typedef nsTObsoleteAString_CharT obsolete_string_type
typedef nsTSubstring_CharT substring_type
typedef nsTSubstringTuple_CharT substring_tuple_type
typedef nsReadingIterator
< char_type
const_iterator
typedef nsWritingIterator
< char_type
iterator
typedef nsTStringComparator_CharT comparator_type
typedef PRUint32 size_type
typedef PRUint32 index_type

Detailed Description

nsTAString is the most abstract class in the string hierarchy.

In its original inception, nsTAString was designed to allow the data storage for a string to be separated into multiple fragments. This was intended to enable lazy string flattening or avoid string flattening altogether in some cases. This abstraction, however, meant that every single string operation (including simple operations such as IsEmpty() and BeginReading()) required virtual function calls. A virtual destructor was also required. This not only meant additional overhead for invoking string methods but also added to additional codesize at every callsite (to load the virtual function address).

Today nsTAString exists mainly for backwards compatibility of the string API. It is restricted to representing a contiguous array of characters, where the character array is not necessarily null-terminated. Moreover, since nsTAString's virtual function table was frozen for Mozilla 1.0, nsTAString necessarily maintains ABI compatibility with older versions of Gecko. (nsTObsoleteAString provides that frozen ABI. See nsObsoleteAString.h for a description of how we solve the ABI compatibility requirement while eliminating virtual function calls on nsTAString.)

XPIDL still generates C++ header files with references to nsTAStrings, so nsTAString will still be heavily used in real code.

If the opportunity to break ABI compatibility with Mozilla 1.0 were to ever arise, our first move should be to make nsTAString equate to nsTSubstring. This may in fact be an option today for some Gecko-based products.

Definition at line 106 of file nsTAString.h.


Member Typedef Documentation

Definition at line 116 of file nsTAString.h.

Definition at line 111 of file nsTAString.h.

Definition at line 110 of file nsTAString.h.

Definition at line 124 of file nsTAString.h.

Definition at line 121 of file nsTAString.h.

typedef char_traits::incompatible_char_type nsTAString_CharT::incompatible_char_type

Definition at line 113 of file nsTAString.h.

Definition at line 127 of file nsTAString.h.

Definition at line 122 of file nsTAString.h.

Definition at line 117 of file nsTAString.h.

Definition at line 126 of file nsTAString.h.

Definition at line 119 of file nsTAString.h.

Definition at line 118 of file nsTAString.h.


The documentation for this class was generated from the following file: