XPCOM API Reference

  • Revision slug: XPCOM_API_Reference
  • Revision title: XPCOM API Reference
  • Revision id: 102565
  • Created:
  • Creator: Dria
  • Is current revision? No
  • Comment /* String Functions */

Revision Content


This documentation describes the frozen interfaces and functions provided by the XPCOM library. It also details the helper classes and functions provided by the XPCOM glue library.

Frozen Components

These components may be accessed using the XPCOM Component Manager (or Service Manager).

nsDirectoryService 
The XPCOM Directory Service.
nsObserverService 
The XPCOM Observer Service.
nsScriptableInputStream 
A component implementing nsIScriptableInputStream.

Frozen Functions

These functions are exported from the XPCOM shared library.

Core Functions

NS_InitXPCOM2 
The NS_InitXPCOM2 function initiates use of the XPCOM library by a process.
NS_ShutdownXPCOM 
The NS_ShutdownXPCOM function terminates use of the XPCOM library.
NS_GetComponentManager 
The NS_GetComponentManager function returns a reference to the XPCOM component manager.
NS_GetComponentRegistrar 
The NS_GetComponentRegistrar function returns a reference to the XPCOM component registrar.
NS_GetServiceManager 
The NS_GetServiceManager function returns a reference to the XPCOM service manager.
NS_GetMemoryManager 
The NS_GetMemoryManager function returns a reference to the XPCOM memory manager.
NS_NewLocalFile 
The NS_NewLocalFile function creates an instance of nsILocalFile that provides a platform independent representation of a file path.
NS_NewNativeLocalFile 
The NS_NewNativeLocalFile function creates an instance of nsILocalFile that provides a platform independent representation of a file path.

String Functions

NS_CStringContainerInit 
The NS_CStringContainerInit function initializes a nsCStringContainer instance for use as a nsACString. This is a low-level API.
NS_CStringContainerFinish 
The NS_CStringContainerFinish function releases any memory allocated by a nsCStringContainer instance. This is a low-level API.
NS_CStringGetData 
The NS_CStringGetData function gives the caller access to the string's internal buffer. 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_CStringCopy 
The NS_CStringCopy function copies the value from one nsACString instance to another. This is a low-level API.
NS_CStringAppendData 
The NS_CStringAppendData function appends data to the existing value of a nsACString instance. This is a low-level API.
NS_CStringInsertData 
The NS_CStringInsertData function appends data to the existing value of a nsACString instance. 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_CStringCloneData 
The NS_CStringCloneData function returns a null-terminated, heap allocated copy of the string's internal buffer.
NS_StringContainerInit 
The NS_StringContainerInit function initializes a nsStringContainer instance for use as a nsAString. This is a low-level API.
NS_StringContainerFinish 
The NS_StringContainerFinish function releases any memory allocated by a nsStringContainer instance. 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_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_StringCopy 
The NS_StringCopy function copies the value from one nsAString instance to another. This is a low-level API.
NS_StringAppendData 
The NS_StringAppendData function appends data to the existing value of a nsAString instance. 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_StringCutData 
The NS_StringCutData function removes a section of the string's internal buffer. 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_CStringToUTF16 
The NS_CStringToUTF16 function converts the value of a nsACString instance to UTF-16 and stores the result in a nsAString instance.
NS_UTF16ToString 
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.

Frozen Interfaces

Core

Files and Directories

Streams

Primitives

Glue Classes

Revision Source

<p><br>
This documentation describes the frozen interfaces and functions provided by the XPCOM library.  It also details the helper classes and functions provided by the XPCOM glue library.
</p>
<h3 name="Frozen_Components"> Frozen Components </h3>
<p>These components may be accessed using the XPCOM Component Manager (or Service Manager).
</p>
<dl><dt> <a href="en/XPCOM_API_Reference/nsDirectoryService">nsDirectoryService</a> </dt><dd> The XPCOM Directory Service.
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsObserverService">nsObserverService</a> </dt><dd> The XPCOM Observer Service.
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsScriptableInputStream">nsScriptableInputStream</a> </dt><dd> A component implementing <code>nsIScriptableInputStream</code>.
</dd></dl>
<h3 name="Frozen_Functions"> Frozen Functions </h3>
<p>These functions are exported from the XPCOM shared library.
</p>
<h4 name="Core_Functions"> Core Functions </h4>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_InitXPCOM2">NS_InitXPCOM2</a> </dt><dd> The <code>NS_InitXPCOM2</code> function initiates use of the XPCOM library by a process. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_ShutdownXPCOM">NS_ShutdownXPCOM</a> </dt><dd> The <code>NS_ShutdownXPCOM</code> function terminates use of the XPCOM library. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_GetComponentManager">NS_GetComponentManager</a> </dt><dd> The <code>NS_GetComponentManager</code> function returns a reference to the XPCOM component manager. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_GetComponentRegistrar">NS_GetComponentRegistrar</a> </dt><dd> The <code>NS_GetComponentRegistrar</code> function returns a reference to the XPCOM component registrar. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_GetServiceManager">NS_GetServiceManager</a> </dt><dd> The <code>NS_GetServiceManager</code> function returns a reference to the XPCOM service manager. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_GetMemoryManager">NS_GetMemoryManager</a> </dt><dd> The <code>NS_GetMemoryManager</code> function returns a reference to the XPCOM memory manager. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_NewLocalFile">NS_NewLocalFile</a> </dt><dd> The <code>NS_NewLocalFile</code> function creates an instance of <code>nsILocalFile</code> that provides a platform independent representation of a file path. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_NewNativeLocalFile">NS_NewNativeLocalFile</a> </dt><dd> The <code>NS_NewNativeLocalFile</code> function creates an instance of <code>nsILocalFile</code> that provides a platform independent representation of a file path.
</dd></dl>
<h4 name="String_Functions"> String Functions </h4>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringContainerInit">NS_CStringContainerInit</a> </dt><dd> The <code>NS_CStringContainerInit</code> function initializes a <code>nsCStringContainer</code> instance for use as a <code>nsACString</code>. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringContainerFinish">NS_CStringContainerFinish</a> </dt><dd> The <code>NS_CStringContainerFinish</code> function releases any memory allocated by a <code>nsCStringContainer</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringGetData">NS_CStringGetData</a> </dt><dd> The <code>NS_CStringGetData</code> function gives the caller access to the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringSetData">NS_CStringSetData</a> </dt><dd> The <code>NS_CStringSetData</code> function copies data into the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringSetDataRange">NS_CStringSetDataRange</a> </dt><dd> The <code>NS_CStringSetDataRange</code> function copies data into a section of the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringCopy">NS_CStringCopy</a> </dt><dd> The <code>NS_CStringCopy</code> function copies the value from one <code>nsACString</code> instance to another. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringAppendData">NS_CStringAppendData</a> </dt><dd> The <code>NS_CStringAppendData</code> function appends data to the existing value of a <code>nsACString</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringInsertData">NS_CStringInsertData</a> </dt><dd> The <code>NS_CStringInsertData</code> function appends data to the existing value of a <code>nsACString</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringCutData">NS_CStringCutData</a> </dt><dd> The <code>NS_CStringCutData</code> function removes a section of the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringCloneData">NS_CStringCloneData</a> </dt><dd> The <code>NS_CStringCloneData</code> function returns a null-terminated, heap allocated copy of the string's internal buffer. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringContainerInit">NS_StringContainerInit</a> </dt><dd> The <code>NS_StringContainerInit</code> function initializes a <code>nsStringContainer</code> instance for use as a <code>nsAString</code>. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringContainerFinish">NS_StringContainerFinish</a> </dt><dd> The <code>NS_StringContainerFinish</code> function releases any memory allocated by a <code>nsStringContainer</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringGetData">NS_StringGetData</a> </dt><dd> The <code>NS_StringGetData</code> function gives the caller access to the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringSetData">NS_StringSetData</a> </dt><dd> The <code>NS_StringSetData</code> function copies data into the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringSetDataRange">NS_StringSetDataRange</a> </dt><dd> The <code>NS_StringSetDataRange</code> function copies data into a section of the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringCopy">NS_StringCopy</a> </dt><dd> The <code>NS_StringCopy</code> function copies the value from one <code>nsAString</code> instance to another. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringAppendData">NS_StringAppendData</a> </dt><dd> The <code>NS_StringAppendData</code> function appends data to the existing value of a <code>nsAString</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringInsertData">NS_StringInsertData</a> </dt><dd> The <code>NS_StringInsertData</code> function appends data to the existing value of a <code>nsACString</code> instance. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringCutData">NS_StringCutData</a> </dt><dd> The <code>NS_StringCutData</code> function removes a section of the string's internal buffer. This is a low-level API. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_StringCloneData">NS_StringCloneData</a> </dt><dd> The <code>NS_StringCloneData</code> function returns a null-terminated, heap allocated copy of the string's internal buffer. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_CStringToUTF16">NS_CStringToUTF16</a> </dt><dd> The <code>NS_CStringToUTF16</code> function converts the value of a <code>nsACString</code> instance to UTF-16 and stores the result in a <code>nsAString</code> instance. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/NS_UTF16ToCString">NS_UTF16ToString</a> </dt><dd> The <code>NS_UTF16ToCString</code> function converts the value of a <code>nsAString</code> instance from UTF-16 to the specified multi-byte encoding and stores the result in a <code>nsACString</code> instance.
</dd></dl>
<h3 name="Frozen_Interfaces"> Frozen Interfaces </h3>
<h4 name="Core"> Core </h4>
<h4 name="Files_and_Directories"> Files and Directories </h4>
<h4 name="Streams"> Streams </h4>
<h4 name="Primitives"> Primitives </h4>
<h3 name="Glue_Classes"> Glue Classes </h3>
Revert to this revision