This header provides wrapper classes around the frozen string API which are roughly equivalent to the internal string classes.
<map id="classes" name="classes">
<area alt="" coords="963,6,1045,54" href="http://developer.mozilla.org/en/nsAString_(External)" shape="rect" title="nsAString_(External)">
<area alt="" coords="939,102,1069,150" href="http://developer.mozilla.org/en/nsStringContainer_(External)" shape="rect" title="nsStringContainer_(External)">
<area alt="" coords="548,198,676,246" href="http://developer.mozilla.org/en/nsString_external" shape="rect" title="nsString_external">
<area alt="" coords="700,198,913,246" href="http://developer.mozilla.org/en/nsDependentSubstring_external" shape="rect" title="nsDependentSubstring_external">
<area alt="" coords="937,198,1071,246" href="http://developer.mozilla.org/en/PromiseFlatString_(External)" shape="rect" title="PromiseFlatString_(External)">
<area alt="" coords="1095,198,1196,246" href="http://developer.mozilla.org/en/nsAutoString_(External)" shape="rect" title="nsAutoString_(External)">
<area alt="" coords="5,294,197,342" href="http://developer.mozilla.org/en/nsDependentString_external" shape="rect" title="nsDependentString_external">
<area alt="" coords="221,294,467,342" href="http://developer.mozilla.org/en/NS_ConvertASCIItoUTF16_external" shape="rect" title="NS_ConvertASCIItoUTF16_external">
<area alt="" coords="491,294,733,342" href="http://developer.mozilla.org/en/NS_ConvertUTF8toUTF16_external" shape="rect" title="NS_ConvertUTF8toUTF16_external">
<area alt="" coords="757,294,869,342" href="http://developer.mozilla.org/en/nsLiteralString_(External)" shape="rect" title="nsLiteralString_(External)"> </map> /files/=nsAString-graph.png)
No public members.
PRUnichar* EndReading() const - sourcePRUnichar CharAt(PRUint32) const - sourcePRUnichar operator[](PRUint32) const - sourcePRUnichar First() const - sourcePRUint32 BeginWriting(PRUnichar**, PRUnichar**, PRUint32) - sourceGet the length, begin writing, and optionally set the length of a string all in one operation. @param newSize Size the string to this length. Pass PR_UINT32_MAX to leave the length unchanged. @return The new length of the string, or 0 if resizing failed.
PRUnichar* BeginWriting(PRUint32) - sourcePRUnichar* EndWriting() - sourcePRBool SetLength(PRUint32) - sourcePRUint32 Length() const - sourcePRBool IsEmpty() const - sourcevoid SetIsVoid(PRBool) - sourcePRBool IsVoid() const - sourcevoid AssignLiteral(const char*) - sourcevoid Replace(PRUint32, PRUint32, const PRUnichar*, PRUint32) - sourcevoid Replace(PRUint32, PRUint32, PRUnichar) - sourcevoid Replace(PRUint32, PRUint32, const nsAString&) - sourcevoid AppendLiteral(const char*) - sourcevoid Cut(PRUint32, PRUint32) - sourcevoid Truncate() - sourcevoid StripChars(const char*) - sourceRemove all occurences of characters in aSet from the string.
void StripWhitespace() - sourceStrip whitespace characters from the string.
void Trim(const char*, PRBool, PRBool) - sourcePRInt32 DefaultComparator(const PRUnichar*, const PRUnichar*, PRUint32) - sourcePRInt32 Compare(const PRUnichar*, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourcePRInt32 Compare(const nsAString&, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourcePRBool Equals(const PRUnichar*, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourcePRBool Equals(const nsAString&, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourcePRBool EqualsLiteral(const char*) const - sourcePRBool LowerCaseEqualsLiteral(const char*) const - sourceCase-insensitive match this string to a lowercase ASCII string.
PRInt32 Find(const nsAString&, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourceFind the first occurrence of aStr in this string. @return the offset of aStr, or -1 if not found
PRInt32 Find(const nsAString&, PRUint32, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourceFind the first occurrence of aStr in this string, beginning at aOffset. @return the offset of aStr, or -1 if not found
PRInt32 Find(const char*, PRBool) const - sourceFind an ASCII string within this string. @return the offset of aStr, or -1 if not found.
PRInt32 Find(const char*, PRUint32, PRBool) const - sourcePRInt32 RFind(const nsAString&, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourceFind the last occurrence of aStr in this string. @return The offset of aStr from the beginning of the string, or -1 if not found.
PRInt32 RFind(const nsAString&, PRInt32, PRInt32 (*)(const PRUnichar*, const PRUnichar*, PRUint32)) const - sourceFind the last occurrence of aStr in this string, beginning at aOffset. @param aOffset the offset from the beginning of the string to begin searching. If aOffset < 0, search from end of this string. @return The offset of aStr from the beginning of the string, or -1 if not found.
PRInt32 RFind(const char*, PRBool) const - sourceFind the last occurrence of an ASCII string within this string. @return The offset of aStr from the beginning of the string, or -1 if not found.
PRInt32 RFind(const char*, PRInt32, PRBool) const - sourceFind the last occurrence of an ASCII string beginning at aOffset. @param aOffset the offset from the beginning of the string to begin searching. If aOffset < 0, search from end of this string. @return The offset of aStr from the beginning of the string, or -1 if not found.
PRInt32 FindChar(PRUnichar, PRUint32) const - sourceSearch for the offset of the first occurrence of a character in a string. @param aOffset the offset from the beginning of the string to begin searching @return The offset of the character from the beginning of the string, or -1 if not found.
PRInt32 RFindChar(PRUnichar) const - sourceSearch for the offset of the last occurrence of a character in a string. @return The offset of the character from the beginning of the string, or -1 if not found.
void AppendInt(int, PRInt32) - sourceAppend a string representation of a number.
PRInt32 ToInteger(nsresult*, PRUint32) const - sourceConvert this string to an integer. @param aErrorCode pointer to contain result code. @param aRadix must be 10 or 16