Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

nsTAString_CharT Class Reference

#include <nsTAString.h>

Inheritance diagram for nsTAString_CharT:

nsTSubstring_CharT nsTDependentSubstring_CharT nsTString_CharT nsTDependentString_CharT nsTPromiseFlatString_CharT nsTXPIDLString_CharT nsTAutoString_CharT nsTAdoptingString_CharT

List of all members.


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 103 of file nsTAString.h.


Public Types

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

Public Member Functions

NS_COM void NS_FASTCALL Append (char_type c)
NS_COM void NS_FASTCALL Append (const char_type *data, size_type length)
NS_COM void NS_FASTCALL Append (const char_type *data)
NS_COM void NS_FASTCALL Append (const substring_tuple_type &tuple)
NS_COM void NS_FASTCALL Append (const self_type &readable)
NS_COM void NS_FASTCALL AppendASCII (const char *data)
NS_COM void NS_FASTCALL AppendASCII (const char *data, size_type length)
template<int N>
void AppendLiteral (char(&str)[N])
template<int N>
void AppendLiteral (const char(&str)[N])
NS_COM void NS_FASTCALL Assign (char_type c)
NS_COM void NS_FASTCALL Assign (const char_type *data, size_type length)
NS_COM void NS_FASTCALL Assign (const char_type *data)
NS_COM void NS_FASTCALL Assign (const substring_tuple_type &tuple)
NS_COM void NS_FASTCALL Assign (const self_type &readable)
NS_COM void NS_FASTCALL AssignASCII (const char *data)
NS_COM void NS_FASTCALL AssignASCII (const char *data, size_type length)
template<int N>
void AssignLiteral (char(&str)[N])
template<int N>
void AssignLiteral (const char(&str)[N])
const_iteratorBeginReading (const_iterator &iter) const
iteratorBeginWriting (iterator &iter)
NS_COM size_type NS_FASTCALL CountChar (char_type) const
NS_COM void NS_FASTCALL Cut (index_type cutStart, size_type cutLength)
const_iteratorEndReading (const_iterator &iter) const
iteratorEndWriting (iterator &iter)
NS_COM PRBool NS_FASTCALL Equals (const char_type *, const comparator_type &) const
NS_COM PRBool NS_FASTCALL Equals (const char_type *) const
NS_COM PRBool NS_FASTCALL Equals (const self_type &, const comparator_type &) const
NS_COM PRBool NS_FASTCALL Equals (const self_type &) const
NS_COM PRBool NS_FASTCALL EqualsASCII (const char *data) const
NS_COM PRBool NS_FASTCALL EqualsASCII (const char *data, size_type len) const
template<int N>
PRBool EqualsLiteral (char(&str)[N]) const
template<int N>
PRBool EqualsLiteral (const char(&str)[N]) const
NS_COM PRInt32 NS_FASTCALL FindChar (char_type, index_type offset=0) const
NS_COM char_type NS_FASTCALL First () const
NS_COM void NS_FASTCALL Insert (char_type c, index_type pos)
NS_COM void NS_FASTCALL Insert (const char_type *data, index_type pos, size_type length)
NS_COM void NS_FASTCALL Insert (const char_type *data, index_type pos)
NS_COM void NS_FASTCALL Insert (const substring_tuple_type &tuple, index_type pos)
NS_COM void NS_FASTCALL Insert (const self_type &readable, index_type pos)
PRBool IsEmpty () const
NS_COM PRBool NS_FASTCALL IsTerminated () const
NS_COM PRBool NS_FASTCALL IsVoid () const
NS_COM char_type NS_FASTCALL Last () const
NS_COM size_type NS_FASTCALL Length () const
NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII (const char *data) const
NS_COM PRBool NS_FASTCALL LowerCaseEqualsASCII (const char *data, size_type len) const
template<int N>
PRBool LowerCaseEqualsLiteral (char(&str)[N]) const
template<int N>
PRBool LowerCaseEqualsLiteral (const char(&str)[N]) const
 nsTAString_CharT (const substring_tuple_type &tuple)
self_typeoperator+= (char_type c)
self_typeoperator+= (const char_type *data)
self_typeoperator+= (const substring_tuple_type &tuple)
self_typeoperator+= (const self_type &readable)
self_typeoperator= (char_type c)
self_typeoperator= (const char_type *data)
self_typeoperator= (const substring_tuple_type &tuple)
self_typeoperator= (const self_type &readable)
NS_COM void NS_FASTCALL Replace (index_type cutStart, size_type cutLength, const substring_tuple_type &readable)
NS_COM void NS_FASTCALL Replace (index_type cutStart, size_type cutLength, const self_type &readable)
NS_COM void NS_FASTCALL SetCapacity (size_type)
NS_COM void NS_FASTCALL SetIsVoid (PRBool)
NS_COM void NS_FASTCALL SetLength (size_type)
void Truncate (size_type aNewLength=0)
NS_COM NS_FASTCALL ~nsTAString_CharT ()

Protected Member Functions

obsolete_string_typeAsObsoleteString ()
const obsolete_string_typeAsObsoleteString () const
substring_typeAsSubstring ()
const substring_typeAsSubstring () const
NS_COM size_type NS_FASTCALL GetReadableBuffer (const char_type **data) const
NS_COM size_type NS_FASTCALL GetWritableBuffer (char_type **data)
PRBool NS_FASTCALL IsDependentOn (const char_type *start, const char_type *end) const
 nsTAString_CharT (PRUint32 flags)
 nsTAString_CharT (char_type *data, size_type length, PRUint32 flags)
const substring_type NS_FASTCALL ToSubstring () const

Protected Attributes

char_type * mData
PRUint32 mFlags
size_type mLength
const void * mVTable

Private Member Functions

void Append (incompatible_char_type)
void Assign (incompatible_char_type)
void Insert (incompatible_char_type, index_type)
 nsTAString_CharT (const self_type &)
void operator+= (incompatible_char_type)
void operator= (incompatible_char_type)

Friends

class nsTDependentSubstring_CharT
class nsTPromiseFlatString_CharT
class nsTSubstring_CharT
class nsTSubstringTuple_CharT

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

Generated by  Doxygen 1.6.0   Back to index