nsTSubstring is the most abstract class in the string hierarchy. It represents a single contiguous array of characters, which may or may not be null-terminated. This type is not instantiated directly. A sub-class is instantiated instead. For example, see nsTString. NAMES: nsAString for wide characters nsACString for narrow characters Many of the accessors on nsTSubstring are inlined as an optimization.<map id="classes" name="classes"> <area alt="" coords="456,5,605,53" href="http://developer.mozilla.org/en/nsACString_internal" shape="rect" title="nsACString_internal"> <area alt="" coords="415,101,497,149" href="http://developer.mozilla.org/en/nsCString" shape="rect" title="nsCString"> <area alt="" coords="521,101,689,149" href="http://developer.mozilla.org/en/nsDependentCSubstring" shape="rect" title="nsDependentCSubstring"> <area alt="" coords="172,197,289,245" href="http://developer.mozilla.org/en/nsFixedCString" shape="rect" title="nsFixedCString"> <area alt="" coords="315,197,437,245" href="http://developer.mozilla.org/en/nsXPIDLCString" shape="rect" title="nsXPIDLCString"> <area alt="" coords="461,197,611,245" href="http://developer.mozilla.org/en/nsDependentCString" shape="rect" title="nsDependentCString"> <area alt="" coords="635,197,787,245" href="http://developer.mozilla.org/en/nsPromiseFlatCString" shape="rect" title="nsPromiseFlatCString"> <area alt="" coords="173,293,285,341" href="http://developer.mozilla.org/en/nsCAutoString" shape="rect" title="nsCAutoString"> <area alt="" coords="5,389,227,437" href="http://developer.mozilla.org/en/NS_LossyConvertUTF16toASCII" shape="rect" title="NS_LossyConvertUTF16toASCII"> <area alt="" coords="251,389,435,437" href="http://developer.mozilla.org/en/NS_ConvertUTF16toUTF8" shape="rect" title="NS_ConvertUTF16toUTF8"> <area alt="" coords="309,293,445,341" href="http://developer.mozilla.org/en/nsAdoptingCString" shape="rect" title="nsAdoptingCString"> </map>
No public members.
void nsACString_internal(const nsCSubstringTuple&)
- source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nsTAString.
void nsACString_internal(char*, PRUint32, PRUint32)
- source char* Data() const
- source accessors
PRUint32 Length() const
- source PRBool IsEmpty() const
- source PRBool IsVoid() const
- source PRBool IsTerminated() const
- source char CharAt(PRUint32) const
- source char operator[](PRUint32) const
- source char First() const
- source char Last() const
- source PRUint32 CountChar(char) const
- source PRInt32 FindChar(char, PRUint32) const
- source PRBool Equals(const nsACString_internal&) const
- source equality
PRBool Equals(const nsACString_internal&, const nsCStringComparator&) const
- source PRBool Equals(const char*) const
- source PRBool Equals(const char*, const nsCStringComparator&) const
- source PRBool EqualsASCII(const char*, PRUint32) const
- source An efficient comparison with ASCII that can be used even for wide strings. Call this version when you know the length of 'data'.
PRBool EqualsASCII(const char*) const
- source An efficient comparison with ASCII that can be used even for wide strings. Call this version when 'data' is null-terminated.
PRBool EqualsLiteral(const char (&)[N]) const
- source PRBool EqualsLiteral(char (&)[N]) const
- source PRBool LowerCaseEqualsLiteral(const char (&)[N]) const
- source PRBool LowerCaseEqualsLiteral(char (&)[N]) const
- source void Assign(char)
- source assignment
void Assign(const char*, PRUint32)
- source void Assign(const nsACString_internal&)
- source void Assign(const nsCSubstringTuple&)
- source void AssignLiteral(const char (&)[N])
- source void AssignLiteral(char (&)[N])
- source nsACString_internal& operator=(char)
- source nsACString_internal& operator=(const char*)
- source nsACString_internal& operator=(const nsACString_internal&)
- source nsACString_internal& operator=(const nsCSubstringTuple&)
- source void Adopt(char*, PRUint32)
- source void Replace(PRUint32, PRUint32, char)
- source buffer manipulation
void Replace(PRUint32, PRUint32, const char*, PRUint32)
- source void Replace(PRUint32, PRUint32, const nsACString_internal&)
- source void Replace(PRUint32, PRUint32, const nsCSubstringTuple&)
- source void ReplaceASCII(PRUint32, PRUint32, const char*, PRUint32)
- source void AppendASCII(const char*, PRUint32)
- source void AppendLiteral(const char (&)[N])
- source void AppendLiteral(char (&)[N])
- source nsACString_internal& operator+=(char)
- source nsACString_internal& operator+=(const char*)
- source nsACString_internal& operator+=(const nsACString_internal&)
- source nsACString_internal& operator+=(const nsCSubstringTuple&)
- source void Insert(char, PRUint32)
- source void Insert(const char*, PRUint32, PRUint32)
- source void Insert(const nsACString_internal&, PRUint32)
- source void Insert(const nsCSubstringTuple&, PRUint32)
- source void Cut(PRUint32, PRUint32)
- source void SetCapacity(PRUint32)
- source buffer sizing
void SetLength(PRUint32)
- source void Truncate(PRUint32)
- source PRUint32 GetData(const char**) const
- source Get a const pointer to the string's internal buffer. The caller MUST NOT modify the characters at the returned address. @returns The length of the buffer in characters.
PRUint32 GetMutableData(char**, PRUint32)
- source Get a pointer to the string's internal buffer, optionally resizing the buffer first. If size_type(-1) is passed for newLen, then the current length of the string is used. The caller MAY modify the characters at the returned address (up to but not exceeding the length of the string). @returns The length of the buffer in characters or 0 if unable to satisfy the request due to low-memory conditions.
void SetIsVoid(PRBool)
- source string data is never null, but can be marked void. if true, the string will be truncated. @see nsTSubstring::IsVoid
void StripChar(char, PRInt32)
- source This method is used to remove all occurrences of aChar from this string. @param aChar -- char to be stripped @param aOffset -- where in this string to start stripping chars