#include <nsStringAPI.h>
Inheritance diagram for nsACString:Public Types | |
| typedef char | char_type |
| typedef nsACString | self_type |
| typedef PRUint32 | size_type |
| typedef PRUint32 | index_type |
| typedef PRInt32(* | ComparatorFunc )(const char_type *a, const char_type *b, PRUint32 length) |
| Compare strings of characters. | |
Public Member Functions | |
| PRUint32 | BeginReading (const char_type **begin, const char_type **end=0L) const |
| Returns the length, beginning, and end of a string in one operation. | |
| const char_type * | BeginReading () const |
| const char_type * | EndReading () const |
| char_type | CharAt (PRUint32 aPos) const |
| char_type | operator[] (PRUint32 aPos) const |
| char_type | First () const |
| PRUint32 | BeginWriting (char_type **begin, char_type **end=0L, PRUint32 newSize=PR_UINT32(4294967295)) |
| Get the length, begin writing, and optionally set the length of a string all in one operation. | |
| char_type * | BeginWriting (PRUint32 aLen=PR_UINT32(4294967295)) |
| char_type * | EndWriting () |
| PRBool | SetLength (PRUint32 aLen) |
| size_type | Length () const |
| PRBool | IsEmpty () const |
| void | SetIsVoid (PRBool val) |
| PRBool | IsVoid () const |
| void | Assign (const self_type &aString) |
| void | Assign (const char_type *aData, size_type aLength=PR_UINT32(4294967295)) |
| void | Assign (char_type aChar) |
| void | AssignLiteral (const char_type *aData) |
| self_type & | operator= (const self_type &aString) |
| self_type & | operator= (const char_type *aPtr) |
| self_type & | operator= (char_type aChar) |
| void | Replace (index_type cutStart, size_type cutLength, const char_type *data, size_type length=size_type(-1)) |
| void | Replace (index_type cutStart, size_type cutLength, char_type c) |
| void | Replace (index_type cutStart, size_type cutLength, const self_type &readable) |
| void | Append (char_type c) |
| void | Append (const char_type *data, size_type length=size_type(-1)) |
| void | Append (const self_type &readable) |
| void | AppendLiteral (const char *aASCIIStr) |
| self_type & | operator+= (char_type c) |
| self_type & | operator+= (const char_type *data) |
| self_type & | operator+= (const self_type &readable) |
| void | Insert (char_type c, index_type pos) |
| void | Insert (const char_type *data, index_type pos, size_type length=size_type(-1)) |
| void | Insert (const self_type &readable, index_type pos) |
| void | Cut (index_type cutStart, size_type cutLength) |
| void | Truncate () |
| void | StripChars (const char *aSet) |
| Remove all occurences of characters in aSet from the string. | |
| void | StripWhitespace () |
| Strip whitespace characters from the string. | |
| void | Trim (const char *aSet, PRBool aLeading=1, PRBool aTrailing=1) |
| PRInt32 | Compare (const char_type *other, ComparatorFunc c=DefaultComparator) const |
| PRInt32 | Compare (const self_type &other, ComparatorFunc c=DefaultComparator) const |
| PRBool | Equals (const char_type *other, ComparatorFunc c=DefaultComparator) const |
| PRBool | Equals (const self_type &other, ComparatorFunc c=DefaultComparator) const |
| PRBool | operator< (const self_type &other) const |
| PRBool | operator< (const char_type *other) const |
| PRBool | operator<= (const self_type &other) const |
| PRBool | operator<= (const char_type *other) const |
| PRBool | operator== (const self_type &other) const |
| PRBool | operator== (const char_type *other) const |
| PRBool | operator>= (const self_type &other) const |
| PRBool | operator>= (const char_type *other) const |
| PRBool | operator> (const self_type &other) const |
| PRBool | operator> (const char_type *other) const |
| PRBool | operator!= (const self_type &other) const |
| PRBool | operator!= (const char_type *other) const |
| PRBool | EqualsLiteral (const char_type *other) const |
| PRInt32 | Find (const self_type &aStr, ComparatorFunc c=DefaultComparator) const |
| Find the first occurrence of aStr in this string. | |
| PRInt32 | Find (const self_type &aStr, PRUint32 aOffset, ComparatorFunc c=DefaultComparator) const |
| Find the first occurrence of aStr in this string, beginning at aOffset. | |
| PRInt32 | Find (const char_type *aStr, ComparatorFunc c=DefaultComparator) const |
| Find the first occurrence of aStr in this string. | |
| PRInt32 | Find (const char_type *aStr, PRUint32 aLen, ComparatorFunc c=DefaultComparator) const |
| PRInt32 | RFind (const self_type &aStr, ComparatorFunc c=DefaultComparator) const |
| Find the last occurrence of aStr in this string. | |
| PRInt32 | RFind (const self_type &aStr, PRInt32 aOffset, ComparatorFunc c=DefaultComparator) const |
| Find the last occurrence of aStr in this string, beginning at aOffset. | |
| PRInt32 | RFind (const char_type *aStr, ComparatorFunc c=DefaultComparator) const |
| Find the last occurrence of aStr in this string. | |
| PRInt32 | RFind (const char_type *aStr, PRInt32 aLen, ComparatorFunc c=DefaultComparator) const |
| Find the last occurrence of an ASCII string in this string, beginning at aOffset. | |
| PRInt32 | FindChar (char_type aChar, PRUint32 aOffset=0) const |
| Search for the offset of the first occurrence of a character in a string. | |
| PRInt32 | RFindChar (char_type aChar) const |
| Search for the offset of the last occurrence of a character in a string. | |
| void | AppendInt (int aInt, PRInt32 aRadix=10) |
| Append a string representation of a number. | |
| PRInt32 | ToInteger (nsresult *aErrorCode, PRUint32 aRadix=10) const |
| Convert this string to an integer. | |
Static Public Member Functions | |
| static PRInt32 | DefaultComparator (const char_type *a, const char_type *b, PRUint32 length) |
Protected Member Functions | |
| ~nsACString () | |
| typedef char nsACString::char_type |
| typedef PRInt32(* nsACString::ComparatorFunc)(const char_type *a, const char_type *b, PRUint32 length) |
Compare strings of characters.
Return 0 if the characters are equal,
| typedef PRUint32 nsACString::index_type |
| typedef nsACString nsACString::self_type |
| typedef PRUint32 nsACString::size_type |
| nsACString::~nsACString | ( | ) | [inline, protected] |
| void nsACString::Append | ( | char_type | c | ) | [inline] |
| void nsACString::Append | ( | const self_type & | readable | ) | [inline] |
| void nsACString::AppendInt | ( | int | aInt, | |
| PRInt32 | aRadix = 10 | |||
| ) |
Append a string representation of a number.
| void nsACString::AppendLiteral | ( | const char * | aASCIIStr | ) | [inline] |
| void nsACString::Assign | ( | const char_type * | aData, | |
| size_type | aLength = PR_UINT32(4294967295) | |||
| ) | [inline] |
| void nsACString::Assign | ( | char_type | aChar | ) | [inline] |
| void nsACString::Assign | ( | const self_type & | aString | ) | [inline] |
| void nsACString::AssignLiteral | ( | const char_type * | aData | ) | [inline] |
| const char_type* nsACString::BeginReading | ( | ) | const |
Returns the length, beginning, and end of a string in one operation.
| char_type* nsACString::BeginWriting | ( | PRUint32 | aLen = PR_UINT32(4294967295) |
) |
| PRUint32 nsACString::BeginWriting | ( | char_type ** | begin, | |
| char_type ** | end = 0L, |
|||
| PRUint32 | newSize = PR_UINT32(4294967295) | |||
| ) |
Get the length, begin writing, and optionally set the length of a string all in one operation.
| newSize | Size the string to this length. Pass PR_UINT32_MAX to leave the length unchanged. |
| char_type nsACString::CharAt | ( | PRUint32 | aPos | ) | const [inline] |
| PRInt32 nsACString::Compare | ( | const char_type * | other, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
| PRInt32 nsACString::Compare | ( | const self_type & | other, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
| void nsACString::Cut | ( | index_type | cutStart, | |
| size_type | cutLength | |||
| ) | [inline] |
| static PRInt32 nsACString::DefaultComparator | ( | const char_type * | a, | |
| const char_type * | b, | |||
| PRUint32 | length | |||
| ) | [static] |
| const char_type* nsACString::EndReading | ( | ) | const |
| char_type* nsACString::EndWriting | ( | ) |
| PRBool nsACString::Equals | ( | const char_type * | other, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
| PRBool nsACString::Equals | ( | const self_type & | other, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
| PRInt32 nsACString::Find | ( | const self_type & | aStr, | |
| PRUint32 | aOffset, | |||
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
Find the first occurrence of aStr in this string, beginning at aOffset.
| PRInt32 nsACString::Find | ( | const char_type * | aStr, | |
| PRUint32 | aLen, | |||
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
| PRInt32 nsACString::Find | ( | const self_type & | aStr, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const [inline] |
Find the first occurrence of aStr in this string.
| PRInt32 nsACString::Find | ( | const char_type * | aStr, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
Find the first occurrence of aStr in this string.
| PRInt32 nsACString::FindChar | ( | char_type | aChar, | |
| PRUint32 | aOffset = 0 | |||
| ) | const |
Search for the offset of the first occurrence of a character in a string.
| aOffset | the offset from the beginning of the string to begin searching |
| char_type nsACString::First | ( | ) | const [inline] |
| void nsACString::Insert | ( | char_type | c, | |
| index_type | pos | |||
| ) | [inline] |
| void nsACString::Insert | ( | const char_type * | data, | |
| index_type | pos, | |||
| size_type | length = size_type(-1) | |||
| ) | [inline] |
| void nsACString::Insert | ( | const self_type & | readable, | |
| index_type | pos | |||
| ) | [inline] |
| PRBool nsACString::IsEmpty | ( | ) | const [inline] |
| PRBool nsACString::IsVoid | ( | ) | const [inline] |
| size_type nsACString::Length | ( | ) | const [inline] |
Reimplemented in nsCString_external, and nsCString_external.
Reimplemented in nsCString_external.
Reimplemented in nsCString_external.
| char_type nsACString::operator[] | ( | PRUint32 | aPos | ) | const [inline] |
| void nsACString::Replace | ( | index_type | cutStart, | |
| size_type | cutLength, | |||
| const char_type * | data, | |||
| size_type | length = size_type(-1) | |||
| ) | [inline] |
| void nsACString::Replace | ( | index_type | cutStart, | |
| size_type | cutLength, | |||
| char_type | c | |||
| ) | [inline] |
| void nsACString::Replace | ( | index_type | cutStart, | |
| size_type | cutLength, | |||
| const self_type & | readable | |||
| ) | [inline] |
| PRInt32 nsACString::RFind | ( | const self_type & | aStr, | |
| PRInt32 | aOffset, | |||
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
Find the last occurrence of aStr in this string, beginning at aOffset.
| aOffset | the offset from the beginning of the string to begin searching. If aOffset < 0, search from end of this string. |
| PRInt32 nsACString::RFind | ( | const char_type * | aStr, | |
| PRInt32 | aLen, | |||
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
Find the last occurrence of an ASCII string in this string, beginning at aOffset.
| aLen | is the length of aStr |
| PRInt32 nsACString::RFind | ( | const self_type & | aStr, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const [inline] |
Find the last occurrence of aStr in this string.
| PRInt32 nsACString::RFind | ( | const char_type * | aStr, | |
| ComparatorFunc | c = DefaultComparator | |||
| ) | const |
Find the last occurrence of aStr in this string.
| PRInt32 nsACString::RFindChar | ( | char_type | aChar | ) | const |
Search for the offset of the last occurrence of a character in a string.
| void nsACString::SetIsVoid | ( | PRBool | val | ) | [inline] |
| PRBool nsACString::SetLength | ( | PRUint32 | aLen | ) |
| void nsACString::StripChars | ( | const char * | aSet | ) |
Remove all occurences of characters in aSet from the string.
| void nsACString::StripWhitespace | ( | ) | [inline] |
Strip whitespace characters from the string.
| PRInt32 nsACString::ToInteger | ( | nsresult * | aErrorCode, | |
| PRUint32 | aRadix = 10 | |||
| ) | const |
Convert this string to an integer.
| aErrorCode | pointer to contain result code. | |
| aRadix | must be 10 or 16 |
| void nsACString::Truncate | ( | ) | [inline] |
1.7.1