|
PRInt32 | nsString_FindCharInSet (const nsAString &aString, const char *aPattern, PRInt32 aOffset=0) |
|
void | AppendInt (nsAString &str, PRUint64 val) |
|
PRInt64 | nsString_ToInt64 (const nsAString &str, nsresult *rv=nsnull) |
|
PRUint64 | nsString_ToUint64 (const nsAString &str, nsresult *rv=nsnull) |
|
void | SB_CompressWhitespace (nsAString &aString, PRBool aLeading=PR_TRUE, PRBool aTrailing=PR_TRUE) |
|
nsresult | SB_StringEnumeratorEquals (nsIStringEnumerator *aLeft, nsIStringEnumerator *aRight, PRBool *_retval) |
|
void | nsString_ReplaceChar (nsAString &aString, const nsAString &aOldChars, const PRUnichar aNewChar) |
|
void | nsCString_ReplaceChars (nsACString &aOldString, const nsACString &aOldChars, const char aNewChar) |
|
void | nsString_ReplaceSubstring (nsAString &aString, const nsAString &aOldString, const nsAString &aNewString) |
|
PRBool | IsLikelyUTF8 (const nsACString &aString) |
|
PRBool | IsUTF8 (const nsACString &aString) |
|
void | nsString_Split (const nsAString &aString, const nsAString &aDelimiter, nsTArray< nsString > &aSubStringArray) |
|
void | nsCString_Split (const nsACString &aString, const nsACString &aDelimiter, nsTArray< nsCString > &aSubStringArray) |
|
nsString | SB_FormatISO8601TimeString (PRTime aTime) |
|
nsresult | SB_ParseISO8601TimeString (const nsAString &aISO8601TimeString, PRTime *aTime) |
|
nsresult | SBGetLocalizedString (nsAString &aString, const nsAString &aKey, const nsAString &aDefault, class nsIStringBundle *aStringBundle=nsnull) |
|
nsresult | SBGetLocalizedString (nsAString &aString, const nsAString &aKey) |
|
nsresult | SBGetLocalizedString (nsAString &aString, const char *aKey, const char *aDefault=nsnull, class nsIStringBundle *aStringBundle=nsnull) |
|
nsresult | SBGetLocalizedFormattedString (nsAString &aString, const nsAString &aKey, const nsTArray< nsString > &aParams, const nsAString &aDefault, class nsIStringBundle *aStringBundle) |
|
template<class T > |
T const & | sbAppendStringArrayDefaultExtractor (T const &aArrayItem) |
|
template<class S , class Sep , class T , class E > |
S | sbAppendStringArray (S &aTarget, Sep const &aSeparator, T const &aStringArray, E aExtractor) |
|
template<class S , class Sep , class T > |
S | sbAppendStringArray (S &aTarget, Sep const &aSeparator, T const &aStringArray) |
|
template<class StringType , class EnumeratorType > |
nsresult | sbAppendStringEnumerator (StringType &aStringArray, EnumeratorType *aEnumerator) |
|
| SB_AUTO_NULL_CLASS (sbAutoSmprintf, char *, PR_smprintf_free(mValue)) |
|
template<class T > |
T | sbEscapeXML (T const &aSrc) |
|
PRBool IsLikelyUTF8 |
( |
const nsACString & |
aString | ) |
|
Return true if the given string is possibly UTF8 (i.e. it errs on the side of returning true)
Note that it assumes all 7-bit encodings are utf8, and doesn't check for invalid characters (e.g. 0xFFFE, surrogates). This is a weaker check than the nsReadableUtils version.
Definition at line 274 of file sbStringUtils.cpp.
template<class StringType , class EnumeratorType >
nsresult sbAppendStringEnumerator |
( |
StringType & |
aStringArray, |
|
|
EnumeratorType * |
aEnumerator |
|
) |
| |
|
inline |
Append the strings in the string enumerator specified by aEnumerator to the string array specified by aStringArray.
- Parameters
-
aStringArray | String array to which to append. |
aEnumerator | Source string enumerator. |
Example:
nsTArray<nsString> stringArray; nsCOMPtr<nsIStringEnumerator> stringEnumerator = GetStringEnumerator(); sbAppendStringEnumerator(stringArray, stringEnumerator);
Definition at line 488 of file sbStringUtils.h.
nsresult SBGetLocalizedFormattedString |
( |
nsAString & |
aString, |
|
|
const nsAString & |
aKey, |
|
|
const nsTArray< nsString > & |
aParams, |
|
|
const nsAString & |
aDefault, |
|
|
class nsIStringBundle * |
aStringBundle |
|
) |
| |
Get and return in aString the formatted localized string with the key specified by aKey using the format parameters specified by aParams and the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is void, return aKey. If aStringBundle is not specified, use the main Songbird string bundle.
- Parameters
-
aString | Returned localized string. |
aKey | Localized string key. |
aParams | Format params array. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Definition at line 593 of file sbStringUtils.cpp.
nsresult SBGetLocalizedString |
( |
nsAString & |
aString, |
|
|
const nsAString & |
aKey, |
|
|
const nsAString & |
aDefault, |
|
|
class nsIStringBundle * |
aStringBundle |
|
) |
| |
Get and return in aString the localized string with the key specified by aKey using the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is not specified, return aKey.
If aStringBundle is not specified, use the main Songbird string bundle.
- Parameters
-
aString | Returned localized string. |
aKey | Localized string key. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Get and return in aString the localized string with the key specified by aKey using the string bundle specified by aStringBundle. If the string cannot be found, return the default string specified by aDefault; if aDefault is void, return aKey.
If aStringBundle is not specified, use the main Songbird string bundle.
- Parameters
-
aString | Returned localized string. |
aKey | Localized string key. |
aDefault | Optional default string. |
aStringBundle | Optional string bundle. |
Definition at line 513 of file sbStringUtils.cpp.