nsACString (External) 编辑
<map id="classes" name="classes"><area alt="" coords="1005,6,1096,54" href="http://developer.mozilla.org/en/nsACString_(External)" shape="rect" title="nsACString_(External)"> <area alt="" coords="980,102,1121,150" href="http://developer.mozilla.org/en/nsCStringContainer_(External)" shape="rect" title="nsCStringContainer_(External)"> <area alt="" coords="571,198,707,246" href="http://developer.mozilla.org/en/nsCString_external" shape="rect" title="nsCString_external"> <area alt="" coords="731,198,955,246" href="http://developer.mozilla.org/en/nsDependentCSubstring_external" shape="rect" title="nsDependentCSubstring_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/PromiseFlatCString_(External)" shape="rect" title="PromiseFlatCString_(External)"> <area alt="" coords="1147,198,1259,246" href="http://developer.mozilla.org/en/nsCAutoString_(External)" shape="rect" title="nsCAutoString_(External)"> <area alt="" coords="5,294,208,342" href="http://developer.mozilla.org/en/nsDependentCString_external" shape="rect" title="nsDependentCString_external"> <area alt="" coords="232,294,475,342" href="http://developer.mozilla.org/en/NS_ConvertUTF16toUTF8_external" shape="rect" title="NS_ConvertUTF16toUTF8_external"> <area alt="" coords="499,294,779,342" href="http://developer.mozilla.org/en/NS_LossyConvertUTF16toASCII_external" shape="rect" title="NS_LossyConvertUTF16toASCII_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsLiteralCString_(External)" shape="rect" title="nsLiteralCString_(External)"></map>
Method Overview
Data Members
No public members.
Methods
BeginReading
PRUint32 BeginReading(const char**, const char**) const
- sourceReturns the length, beginning, and end of a string in one operation.
Parameters
- char** begin
- char** end
char* BeginReading() const
- source
EndReading
char* EndReading() const
- source
CharAt
char CharAt(PRUint32) const
- sourceParameters
- PRUint32 aPos
operator[]
char operator[](PRUint32) const
- sourceParameters
- PRUint32 aPos
First
char First() const
- source
BeginWriting
PRUint32 BeginWriting(char**, char**, 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.
Parameters
- char** begin
- char** end
- PRUint32 newSize
char* BeginWriting(PRUint32)
- sourceParameters
- PRUint32 aLen
EndWriting
char* EndWriting()
- source
SetLength
PRBool SetLength(PRUint32)
- sourceParameters
- PRUint32 aLen
Length
PRUint32 Length() const
- source
IsEmpty
PRBool IsEmpty() const
- source
SetIsVoid
void SetIsVoid(PRBool)
- sourceParameters
- PRBool val
IsVoid
PRBool IsVoid() const
- source
Assign
void Assign(const nsACString&)
- sourceParameters
- nsACString& aString
void Assign(const char*, PRUint32)
- sourceParameters
- char* aData
- PRUint32 aLength
void Assign(char)
- sourceParameters
- char aChar
AssignLiteral
void AssignLiteral(const char*)
- sourceParameters
- char* aData
operator=
nsACString& operator=(const nsACString&)
- sourceParameters
- nsACString& aString
nsACString& operator=(const char*)
- sourceParameters
- char* aPtr
nsACString& operator=(char)
- sourceParameters
- char aChar
Replace
void Replace(PRUint32, PRUint32, const char*, PRUint32)
- sourceParameters
- PRUint32 cutStart
- PRUint32 cutLength
- char* data
- PRUint32 length
void Replace(PRUint32, PRUint32, char)
- sourceParameters
- PRUint32 cutStart
- PRUint32 cutLength
- char c
void Replace(PRUint32, PRUint32, const nsACString&)
- sourceParameters
- PRUint32 cutStart
- PRUint32 cutLength
- nsACString& readable
Append
void Append(char)
- sourceParameters
- char c
void Append(const char*, PRUint32)
- sourceParameters
- char* data
- PRUint32 length
void Append(const nsACString&)
- sourceParameters
- nsACString& readable
AppendLiteral
void AppendLiteral(const char*)
- sourceParameters
- char* aASCIIStr
operator+=
nsACString& operator+=(char)
- sourceParameters
- char c
nsACString& operator+=(const char*)
- sourceParameters
- char* data
nsACString& operator+=(const nsACString&)
- sourceParameters
- nsACString& readable
Insert
void Insert(char, PRUint32)
- sourceParameters
- char c
- PRUint32 pos
void Insert(const char*, PRUint32, PRUint32)
- sourceParameters
- char* data
- PRUint32 pos
- PRUint32 length
void Insert(const nsACString&, PRUint32)
- sourceParameters
- nsACString& readable
- PRUint32 pos
Cut
void Cut(PRUint32, PRUint32)
- sourceParameters
- PRUint32 cutStart
- PRUint32 cutLength
Truncate
void Truncate()
- source
StripChars
void StripChars(const char*)
- sourceRemove all occurrences of characters in aSet from the string.
Parameters
- char* aSet
StripWhitespace
void StripWhitespace()
- sourceStrip whitespace characters from the string.
Trim
void Trim(const char*, PRBool, PRBool)
- sourceParameters
- char* aSet
- PRBool aLeading
- PRBool aTrailing
DefaultComparator
PRInt32 DefaultComparator(const char*, const char*, PRUint32)
- sourceParameters
- char* a
- char* b
- PRUint32 length
Compare
PRInt32 Compare(const char*, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceParameters
- char* other
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 Compare(const nsACString&, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceParameters
- nsACString& other
- PRInt32 (*)(char*, char*, PRUint32) c
Equals
PRBool Equals(const char*, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceParameters
- char* other
- PRInt32 (*)(char*, char*, PRUint32) c
PRBool Equals(const nsACString&, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceParameters
- nsACString& other
- PRInt32 (*)(char*, char*, PRUint32) c
operator<
PRBool operator<(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator<(const char*) const
- sourceParameters
- char* other
operator<=
PRBool operator<=(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator<=(const char*) const
- sourceParameters
- char* other
operator==
PRBool operator==(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator==(const char*) const
- sourceParameters
- char* other
operator>=
PRBool operator>=(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator>=(const char*) const
- sourceParameters
- char* other
operator>
PRBool operator>(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator>(const char*) const
- sourceParameters
- char* other
operator!=
PRBool operator!=(const nsACString&) const
- sourceParameters
- nsACString& other
PRBool operator!=(const char*) const
- sourceParameters
- char* other
EqualsLiteral
PRBool EqualsLiteral(const char*) const
- sourceParameters
- char* other
Find
PRInt32 Find(const nsACString&, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceFind the first occurrence of aStr in this string. @return the offset of aStr, or -1 if not found
Parameters
- nsACString& aStr
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 Find(const nsACString&, PRUint32, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceFind the first occurrence of aStr in this string, beginning at aOffset. @return the offset of aStr, or -1 if not found
Parameters
- nsACString& aStr
- PRUint32 aOffset
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 Find(const char*, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceFind the first occurrence of aStr in this string. @return the offset of aStr, or -1 if not found
Parameters
- char* aStr
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 Find(const char*, PRUint32, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceParameters
- char* aStr
- PRUint32 aLen
- PRInt32 (*)(char*, char*, PRUint32) c
RFind
PRInt32 RFind(const nsACString&, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceFind the last occurrence of aStr in this string. @return The offset of the character from the beginning of the string, or -1 if not found.
Parameters
- nsACString& aStr
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 RFind(const nsACString&, PRInt32, PRInt32 (*)(const char*, const char*, 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.
Parameters
- nsACString& aStr
- PRInt32 aOffset
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 RFind(const char*, PRInt32 (*)(const char*, const char*, 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.
Parameters
- char* aStr
- PRInt32 (*)(char*, char*, PRUint32) c
PRInt32 RFind(const char*, PRInt32, PRInt32 (*)(const char*, const char*, PRUint32)) const
- sourceFind the last occurrence of an ASCII string in this string, beginning at aOffset. @param aLen is the length of aStr @return The offset of aStr from the beginning of the string, or -1 if not found.
Parameters
- char* aStr
- PRInt32 aLen
- PRInt32 (*)(char*, char*, PRUint32) c
FindChar
PRInt32 FindChar(char, 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.
Parameters
- char aChar
- PRUint32 aOffset
RFindChar
PRInt32 RFindChar(char) 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.
Parameters
- char aChar
AppendInt
void AppendInt(int, PRInt32)
- sourceAppend a string representation of a number.
Parameters
- int aInt
- PRInt32 aRadix
ToInteger
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
Parameters
- nsresult* aErrorCode
- PRUint32 aRadix
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论