Revision 102567 of XPCOM API Reference

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

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

nsICategoryManager 
The nsICategoryManager interface provides access to a data structure that holds a list of name-value pairs called categories, where each value is a list of strings.
nsIClassInfo 
The nsIClassInfo interface provides information about a specific implementation class.
nsIComponentManager 
The nsIComponentManager interface provides methods to access factory objects and instantiate instances of classes.
nsIComponentRegistrar 
The nsIComponentRegistrar interface provides methods to access and modify the XPCOM component registry.
nsIFactory 
The nsIFactory interface allows for the creation of nsISupports derived classes without specifying a concrete class type.
nsIInterfaceRequestor 
The nsIInterfaceRequestor interface defines a generic interface for requesting interfaces that a given object might provide access to.
nsIModule 
The nsIModule interface must be implemented by each XPCOM component. It is the main entry point by which the system accesses an XPCOM component.
nsIMemory 
The nsIMemory interface represents a generic memory allocator.
nsIObserver 
The nsIObserver interface is a generic notification callback interface that is typically used in conjunction with nsIObserverService.
nsIObserverService 
The nsIObserverService interface provides methods to add, remove, notify, and enumerate observers of various notifications.
nsIProgrammingLanguage 
The nsIProgrammingLanguage interface provides an enumeration of programming language identifiers.
nsIProperties 
The nsIProperties interface provides methods to access a map of named XPCOM object values.
nsIServiceManager 
The nsIServiceManager manager interface provides a means to obtain global services in an application.
nsISimpleEnumerator 
The nsISimpleEnumerator interface represents an enumeration of XPCOM objects and provides methods to access elements sequentially.
nsISupports 
All XPCOM interfaces inherit the nsISupports interface.
nsISupportsWeakReference 
The nsISupportsWeakReference interface is a factory interface, which produces appropriate instances of nsIWeakReference.
nsIWeakReference 
The nsIWeakReference interface represents a proxy for an XPCOM object. It allows a consumer to hold an indirect, non-owning reference to an XPCOM object.

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>
<dl><dt> <a href="en/XPCOM_API_Reference/nsICategoryManager">nsICategoryManager</a> </dt><dd> The <code>nsICategoryManager</code> interface provides access to a data structure that holds a list of name-value pairs called categories, where each value is a list of strings. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIClassInfo">nsIClassInfo</a> </dt><dd> The <code>nsIClassInfo</code> interface provides information about a specific implementation class. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIComponentManager">nsIComponentManager</a> </dt><dd> The <code>nsIComponentManager</code> interface provides methods to access factory objects and instantiate instances of classes. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIComponentRegistrar">nsIComponentRegistrar</a> </dt><dd> The <code>nsIComponentRegistrar</code> interface provides methods to access and modify the XPCOM component registry. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIFactory">nsIFactory</a> </dt><dd> The <code>nsIFactory</code> interface allows for the creation of <code>nsISupports</code> derived classes without specifying a concrete class type. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIInterfaceRequestor">nsIInterfaceRequestor</a> </dt><dd> The <code>nsIInterfaceRequestor</code> interface defines a generic interface for requesting interfaces that a given object might provide access to. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIModule">nsIModule</a> </dt><dd> The <code>nsIModule</code> interface must be implemented by each XPCOM component. It is the main entry point by which the system accesses an XPCOM component. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIMemory">nsIMemory</a> </dt><dd> The <code>nsIMemory</code> interface represents a generic memory allocator. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIObserver">nsIObserver</a> </dt><dd> The <code>nsIObserver</code> interface is a generic notification callback interface that is typically used in conjunction with <code>nsIObserverService</code>. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIObserverService">nsIObserverService</a> </dt><dd> The <code>nsIObserverService</code> interface provides methods to add, remove, notify, and enumerate observers of various notifications. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIProgrammingLanguage">nsIProgrammingLanguage</a> </dt><dd> The <code>nsIProgrammingLanguage</code> interface provides an enumeration of programming language identifiers. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIProperties">nsIProperties</a> </dt><dd> The <code>nsIProperties</code> interface provides methods to access a map of named XPCOM object values. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIServiceManager">nsIServiceManager</a> </dt><dd> The <code>nsIServiceManager</code> manager interface provides a means to obtain global services in an application. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsISimpleEnumerator">nsISimpleEnumerator</a> </dt><dd> The <code>nsISimpleEnumerator</code> interface represents an enumeration of XPCOM objects and provides methods to access elements sequentially. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsISupports">nsISupports</a> </dt><dd> All XPCOM interfaces inherit the <code>nsISupports</code> interface. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsISupportsWeakReference">nsISupportsWeakReference</a> </dt><dd> The <code>nsISupportsWeakReference</code> interface is a factory interface, which produces appropriate instances of <code>nsIWeakReference</code>. 
</dd></dl>
<dl><dt> <a href="en/XPCOM_API_Reference/nsIWeakReference">nsIWeakReference</a> </dt><dd> The <code>nsIWeakReference</code> interface represents a proxy for an XPCOM object. It allows a consumer to hold an indirect, non-owning reference to an XPCOM object.
</dd></dl>
<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