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="415,5,553,53" href="http://developer.mozilla.org/en/nsAString_internal" shape="rect" title="nsAString_internal"> <area alt="" coords="379,101,451,149" href="http://developer.mozilla.org/en/nsString" shape="rect" title="nsString"> <area alt="" coords="475,101,635,149" href="http://developer.mozilla.org/en/nsDependentSubstring" shape="rect" title="nsDependentSubstring"> <area alt="" coords="151,197,257,245" href="http://developer.mozilla.org/en/nsFixedString" shape="rect" title="nsFixedString"> <area alt="" coords="284,197,396,245" href="http://developer.mozilla.org/en/nsXPIDLString" shape="rect" title="nsXPIDLString"> <area alt="" coords="420,197,559,245" href="http://developer.mozilla.org/en/nsDependentString" shape="rect" title="nsDependentString"> <area alt="" coords="583,197,727,245" href="http://developer.mozilla.org/en/nsPromiseFlatString" shape="rect" title="nsPromiseFlatString"> <area alt="" coords="152,293,253,341" href="http://developer.mozilla.org/en/nsAutoString" shape="rect" title="nsAutoString"> <area alt="" coords="5,389,192,437" href="http://developer.mozilla.org/en/NS_ConvertASCIItoUTF16" shape="rect" title="NS_ConvertASCIItoUTF16"> <area alt="" coords="216,389,400,437" href="http://developer.mozilla.org/en/NS_ConvertUTF8toUTF16" shape="rect" title="NS_ConvertUTF8toUTF16"> <area alt="" coords="277,293,405,341" href="http://developer.mozilla.org/en/nsAdoptingString" shape="rect" title="nsAdoptingString"> </map>
No public members.
void nsAString_internal(const nsSubstringTuple&)
- source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nsTAString.
void nsAString_internal(PRUnichar*, PRUint32, PRUint32)
- source PRUnichar* BeginReading() const
- source reading iterators
nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const
- source deprecated reading iterators
PRUnichar*& BeginReading(const PRUnichar*&) const
- source PRUnichar* BeginWriting()
- source writing iterators
nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&)
- source deprecated writing iterators
PRUnichar*& BeginWriting(PRUnichar*&)
- source PRUnichar* Data() const
- source accessors
PRUint32 Length() const
- source PRBool IsEmpty() const
- source PRBool IsVoid() const
- source PRBool IsTerminated() const
- source PRUnichar CharAt(PRUint32) const
- source PRUnichar operator[](PRUint32) const
- source PRUnichar First() const
- source PRUnichar Last() const
- source PRUint32 CountChar(PRUnichar) const
- source PRInt32 FindChar(PRUnichar, PRUint32) const
- source PRBool Equals(const nsAString_internal&) const
- source equality
PRBool Equals(const nsAString_internal&, const nsStringComparator&) const
- source PRBool Equals(const PRUnichar*) const
- source PRBool Equals(const PRUnichar*, const nsStringComparator&) 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(PRUnichar)
- source assignment
void Assign(const PRUnichar*, PRUint32)
- source void Assign(const nsAString_internal&)
- source void Assign(const nsSubstringTuple&)
- source void AssignLiteral(const char (&)[N])
- source void AssignLiteral(char (&)[N])
- source nsAString_internal& operator=(PRUnichar)
- source nsAString_internal& operator=(const PRUnichar*)
- source nsAString_internal& operator=(const nsAString_internal&)
- source nsAString_internal& operator=(const nsSubstringTuple&)
- source void Adopt(PRUnichar*, PRUint32)
- source void Replace(PRUint32, PRUint32, PRUnichar)
- source buffer manipulation
void Replace(PRUint32, PRUint32, const PRUnichar*, PRUint32)
- source void Replace(PRUint32, PRUint32, const nsAString_internal&)
- source void Replace(PRUint32, PRUint32, const nsSubstringTuple&)
- source void ReplaceASCII(PRUint32, PRUint32, const char*, PRUint32)
- source void Append(PRUnichar)
- source void Append(const PRUnichar*, PRUint32)
- source void Append(const nsAString_internal&)
- source void Append(const nsSubstringTuple&)
- source void AppendASCII(const char*, PRUint32)
- source void AppendLiteral(const char (&)[N])
- source void AppendLiteral(char (&)[N])
- source nsAString_internal& operator+=(PRUnichar)
- source nsAString_internal& operator+=(const PRUnichar*)
- source nsAString_internal& operator+=(const nsAString_internal&)
- source nsAString_internal& operator+=(const nsSubstringTuple&)
- source void Insert(PRUnichar, PRUint32)
- source void Insert(const PRUnichar*, PRUint32, PRUint32)
- source void Insert(const nsAString_internal&, PRUint32)
- source void Insert(const nsSubstringTuple&, PRUint32)
- source void Cut(PRUint32, PRUint32)
- source void SetCapacity(PRUint32)
- source buffer sizing
void SetLength(PRUint32)
- source void Truncate(PRUint32)
- source PRUint32 GetData(const PRUnichar**) 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(PRUnichar**, 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(PRUnichar, 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