XPCOM provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
- NS_CStringAppendData
- The
NS_CStringAppendData
function appends data to the existing value of ansACString
instance. This is a low-level API. - NS_CStringCloneData
- The
NS_CStringCloneData
function returns a null-terminated, heap allocated copy of the string's internal buffer. - NS_CStringContainerFinish
- The
NS_CStringContainerFinish
function releases any memory allocated by ansCStringContainer
instance. - NS_CStringContainerInit
- The
NS_CStringContainerInit
function initializes ansCStringContainer
instance for use as ansACString
. - NS_CStringContainerInit2
- The
NS_CStringContainerInit2
function initializes ansCStringContainer
instance for use as ansACString
. - NS_CStringCopy
- The
NS_CStringCopy
function copies the value from onensACString
instance to another. This is a low-level API. - NS_CStringCutData
- The
NS_CStringCutData
function removes a section of the string's internal buffer. This is a low-level API. - NS_CStringGetData
- The
NS_CStringGetData
function gives the caller read access to the string's internal buffer. - NS_CStringGetMutableData
- The
NS_CStringGetMutableData
function gives the caller write access to the string's internal buffer. - NS_CStringInsertData
- The
NS_CStringInsertData
function appends data to the existing value of ansACString
instance. This is a low-level API. - NS_CStringSetData
- The
NS_CStringSetData
function copies data into the string's internal buffer. This is a low-level API. - NS_CStringSetDataRange
- The
NS_CStringSetDataRange
function copies data into a section of the string's internal buffer. This is a low-level API. - NS_CStringToUTF16
- The
NS_CStringToUTF16
function converts the value of ansACString
instance to UTF-16 and stores the result in ansAString
instance.
- NS_StringAppendData
- The
NS_StringAppendData
function appends data to the existing value of ansAString
instance. This is a low-level API. - NS_StringCloneData
- The
NS_StringCloneData
function returns a null-terminated, heap allocated copy of the string's internal buffer. - NS_StringContainerFinish
- The
NS_StringContainerFinish
function releases any memory allocated by ansStringContainer
instance. This is a low-level API. - NS_StringContainerInit
- The
NS_StringContainerInit
function initializes ansStringContainer
instance for use as ansAString
. This is a low-level API. - NS_StringCopy
- The
NS_StringCopy
function copies the value from one nsAString instance to another. This is a low-level API. - NS_StringCutData
- The
NS_StringCutData
function removes a section of the string's internal buffer. This is a low-level API. - NS_StringGetData
- The
NS_StringGetData
function gives the caller access to the string's internal buffer. This is a low-level API. - NS_StringInsertData
- The
NS_StringInsertData
function appends data to the existing value of ansACString
instance. This is a low-level API. - NS_StringSetData
- The
NS_StringSetData
function copies data into the string's internal buffer. This is a low-level API. - NS_StringSetDataRange
- The
NS_StringSetDataRange
function copies data into a section of the string's internal buffer. This is a low-level API. - NS_UTF16ToCString
- The
NS_UTF16ToCString
function converts the value of ansAString
instance from UTF-16 to the specified multi-byte encoding and stores the result in ansACString
instance.