XPCOM string functions 编辑

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 a nsACString 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 a nsCStringContainer instance.
NS_CStringContainerInit
The NS_CStringContainerInit function initializes a nsCStringContainer instance for use as a nsACString.
NS_CStringContainerInit2
The NS_CStringContainerInit2 function initializes a nsCStringContainer instance for use as a nsACString.
NS_CStringCopy
The NS_CStringCopy function copies the value from one nsACString 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 a nsACString 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 a nsACString instance to UTF-16 and stores the result in a nsAString instance.
NS_StringAppendData
The NS_StringAppendData function appends data to the existing value of a nsAString 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 a nsStringContainer instance. This is a low-level API.
NS_StringContainerInit
The NS_StringContainerInit function initializes a nsStringContainer instance for use as a nsAString. 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 a nsACString 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 a nsAString instance from UTF-16 to the specified multi-byte encoding and stores the result in a nsACString instance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:135 次

字数:8869

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文