Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
nsXPComStub.cpp File Reference
#include "nsXPCOM.h"
#include "nsXPCOMPrivate.h"
#include "nsStringAPI.h"
#include <string.h>

Go to the source code of this file.

Functions

NS_EXPORT nsresult NS_GetFrozenFunctions (XPCOMFunctions *functions, const char *)
NS_EXPORT nsresult NS_InitXPCOM2 (nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *dirProvider)
 Initialises XPCOM.
NS_EXPORT nsresult NS_InitXPCOM3 (nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *dirProvider, nsStaticModuleInfo const *staticComponents, PRUint32 componentCount)
 Initialises XPCOM with static components.
NS_EXPORT nsresult NS_ShutdownXPCOM (nsIServiceManager *svcMgr)
 Shutdown XPCOM.
NS_EXPORT nsresult NS_GetServiceManager (nsIServiceManager **result)
 Public Method to access to the service manager.
NS_EXPORT nsresult NS_GetComponentManager (nsIComponentManager **result)
 Public Method to access to the component manager.
NS_EXPORT nsresult NS_GetComponentRegistrar (nsIComponentRegistrar **result)
 Public Method to access to the component registration manager.
NS_EXPORT nsresult NS_GetMemoryManager (nsIMemory **result)
 Public Method to access to the memory manager.
NS_EXPORT nsresult NS_NewLocalFile (const nsAString &path, PRBool followLinks, nsILocalFile **result)
 Public Method to create an instance of a nsILocalFile.
NS_EXPORT nsresult NS_NewNativeLocalFile (const nsACString &path, PRBool followLinks, nsILocalFile **result)
NS_EXPORT nsresult NS_GetDebug (nsIDebug **result)
NS_EXPORT nsresult NS_GetTraceRefcnt (nsITraceRefcnt **result)
NS_EXPORT voidNS_Alloc (PRSize size)
 Allocates a block of memory of a particular size.
NS_EXPORT voidNS_Realloc (void *ptr, PRSize size)
 Reallocates a block of memory to a new size.
NS_EXPORT void NS_Free (void *ptr)
 Frees a block of memory.
NS_EXPORT nsresult NS_RegisterXPCOMExitRoutine (XPCOMExitRoutine exitRoutine, PRUint32 priority)
NS_EXPORT nsresult NS_UnregisterXPCOMExitRoutine (XPCOMExitRoutine exitRoutine)
NS_EXPORT nsresult NS_StringContainerInit (nsStringContainer &aStr)
 NS_StringContainerInit.
NS_EXPORT nsresult NS_StringContainerInit2 (nsStringContainer &aStr, const PRUnichar *aData, PRUint32 aDataLength, PRUint32 aFlags)
 NS_StringContainerInit2.
NS_EXPORT void NS_StringContainerFinish (nsStringContainer &aStr)
 NS_StringContainerFinish.
NS_EXPORT PRUint32 NS_StringGetData (const nsAString &aStr, const PRUnichar **aBuf, PRBool *aTerm)
 NS_StringGetData.
NS_EXPORT PRUint32 NS_StringGetMutableData (nsAString &aStr, PRUint32 aLen, PRUnichar **aBuf)
 NS_StringGetMutableData.
NS_EXPORT PRUnicharNS_StringCloneData (const nsAString &aStr)
 NS_StringCloneData.
NS_EXPORT nsresult NS_StringSetData (nsAString &aStr, const PRUnichar *aBuf, PRUint32 aCount)
 NS_StringSetData.
NS_EXPORT nsresult NS_StringSetDataRange (nsAString &aStr, PRUint32 aCutStart, PRUint32 aCutLength, const PRUnichar *aBuf, PRUint32 aCount)
 NS_StringSetDataRange.
NS_EXPORT nsresult NS_StringCopy (nsAString &aDest, const nsAString &aSrc)
 NS_StringCopy.
NS_EXPORT nsresult NS_CStringContainerInit (nsCStringContainer &aStr)
 NS_CStringContainerInit.
NS_EXPORT nsresult NS_CStringContainerInit2 (nsCStringContainer &aStr, const char *aData, PRUint32 aDataLength, PRUint32 aFlags)
 NS_CStringContainerInit2.
NS_EXPORT void NS_CStringContainerFinish (nsCStringContainer &aStr)
 NS_CStringContainerFinish.
NS_EXPORT PRUint32 NS_CStringGetData (const nsACString &aStr, const char **aBuf, PRBool *aTerm)
 NS_CStringGetData.
NS_EXPORT PRUint32 NS_CStringGetMutableData (nsACString &aStr, PRUint32 aLen, char **aBuf)
 NS_CStringGetMutableData.
NS_EXPORT char * NS_CStringCloneData (const nsACString &aStr)
 NS_CStringCloneData.
NS_EXPORT nsresult NS_CStringSetData (nsACString &aStr, const char *aBuf, PRUint32 aCount)
 NS_CStringSetData.
NS_EXPORT nsresult NS_CStringSetDataRange (nsACString &aStr, PRUint32 aCutStart, PRUint32 aCutLength, const char *aBuf, PRUint32 aCount)
 NS_CStringSetDataRange.
NS_EXPORT nsresult NS_CStringCopy (nsACString &aDest, const nsACString &aSrc)
 NS_CStringCopy.
NS_EXPORT nsresult NS_CStringToUTF16 (const nsACString &aSrc, nsCStringEncoding aSrcEncoding, nsAString &aDest)
 NS_CStringToUTF16.
NS_EXPORT nsresult NS_UTF16ToCString (const nsAString &aSrc, nsCStringEncoding aDestEncoding, nsACString &aDest)
 NS_UTF16ToCString.

Variables

static const XPCOMFunctions kFrozenFunctions

Function Documentation

Allocates a block of memory of a particular size.

If the memory cannot be allocated (because of an out-of-memory condition), null is returned.

FROZEN

Parameters:
sizeThe size of the block to allocate
Returns:
The block of memory
Note:
This function is thread-safe.

Definition at line 205 of file nsXPComStub.cpp.

{
  return NS_Alloc_P(size);
}
NS_EXPORT char* NS_CStringCloneData ( const nsACString &  aStr)

NS_CStringCloneData.

This function returns a null-terminated copy of the string's internal buffer.

Parameters:
aStrabstract string reference
Returns:
null-terminated copy of the string's internal buffer (it must be free'd using using nsMemory::Free)

FROZEN

Definition at line 353 of file nsXPComStub.cpp.

{
  return NS_CStringCloneData_P(aStr);
}

Here is the call graph for this function:

NS_CStringContainerFinish.

Parameters:
aContainerstring container reference

This function frees any memory owned by aContainer.

FROZEN

Definition at line 332 of file nsXPComStub.cpp.

{
  NS_CStringContainerFinish_P(aStr);
}

NS_CStringContainerInit.

Parameters:
aContainerstring container reference
Returns:
NS_OK if string container successfully initialized

This function may allocate additional memory for aContainer. When aContainer is no longer needed, NS_CStringContainerFinish should be called.

FROZEN

Definition at line 315 of file nsXPComStub.cpp.

{
  return NS_CStringContainerInit_P(aStr);
}
NS_EXPORT nsresult NS_CStringContainerInit2 ( nsCStringContainer aContainer,
const char *  aData = nsnull,
PRUint32  aDataLength = PR_UINT32_MAX,
PRUint32  aFlags = 0 
)

NS_CStringContainerInit2.

Parameters:
aContainerstring container reference
aDatacharacter buffer (may be null)
aDataLengthnumber of characters stored at aData (may pass PR_UINT32_MAX if aData is null-terminated)
aFlagsflags affecting how the string container is initialized. this parameter is ignored when aData is null. otherwise, if this parameter is 0, then aData is copied into the string.

This function resembles NS_CStringContainerInit but provides further options that permit more efficient memory usage. When aContainer is no longer needed, NS_CStringContainerFinish should be called.

NOTE: NS_CStringContainerInit2(container, nsnull, 0, 0) is equivalent to NS_CStringContainerInit(container).

FROZEN

Definition at line 322 of file nsXPComStub.cpp.

{   
  return NS_CStringContainerInit2_P(aStr, aData, aDataLength, aFlags);
}
NS_EXPORT nsresult NS_CStringCopy ( nsACString &  aDestStr,
const nsACString &  aSrcStr 
)

NS_CStringCopy.

This function makes aDestStr have the same value as aSrcStr. It is provided as an optimization.

Parameters:
aDestStrabstract string reference to be modified
aSrcStrabstract string reference containing source string
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aDestStr after copying data from aSrcStr. The behavior depends on the implementation of the abstract string, aDestStr. If aDestStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 375 of file nsXPComStub.cpp.

{
  return NS_CStringCopy_P(aDest, aSrc);
}
NS_EXPORT PRUint32 NS_CStringGetData ( const nsACString &  aStr,
const char **  aData,
PRBool aTerminated = nsnull 
)

NS_CStringGetData.

This function returns a const character pointer to the string's internal buffer, the length of the string, and a boolean value indicating whether or not the buffer is null-terminated.

Parameters:
aStrabstract string reference
aDataout param that will hold the address of aStr's internal buffer
aTerminatedif non-null, this out param will be set to indicate whether or not aStr's internal buffer is null- terminated
Returns:
length of aStr's internal buffer

FROZEN

Definition at line 339 of file nsXPComStub.cpp.

{
  return NS_CStringGetData_P(aStr, aBuf, aTerm);
}
NS_EXPORT PRUint32 NS_CStringGetMutableData ( nsACString &  aStr,
PRUint32  aDataLength,
char **  aData 
)

NS_CStringGetMutableData.

This function provides mutable access to a string's internal buffer. It returns a pointer to an array of characters that may be modified. The returned pointer remains valid until the string object is passed to some other string function.

Optionally, this function may be used to resize the string's internal buffer. The aDataLength parameter specifies the requested length of the string's internal buffer. By passing some value other than PR_UINT32_MAX, the caller can request that the buffer be resized to the specified number of characters before returning. The caller is not responsible for writing a null-terminator.

Parameters:
aStrabstract string reference
aDataLengthnumber of characters to resize the string's internal buffer to or PR_UINT32_MAX if no resizing is needed
aDataout param that upon return holds the address of aStr's internal buffer or null if the function failed
Returns:
number of characters or zero if the function failed

This function does not necessarily null-terminate aStr after resizing its internal buffer. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 346 of file nsXPComStub.cpp.

{
  return NS_CStringGetMutableData_P(aStr, aLen, aBuf);
}
NS_EXPORT nsresult NS_CStringSetData ( nsACString &  aStr,
const char *  aData,
PRUint32  aDataLength = PR_UINT32_MAX 
)

NS_CStringSetData.

This function copies aData into aStr.

Parameters:
aStrabstract string reference
aDatacharacter buffer
aDataLengthnumber of characters to copy from source string (pass PR_UINT32_MAX to copy until end of aData, designated by a null character)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr after copying data from aData. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 360 of file nsXPComStub.cpp.

{
  return NS_CStringSetData_P(aStr, aBuf, aCount);
}
NS_EXPORT nsresult NS_CStringSetDataRange ( nsACString &  aStr,
PRUint32  aCutOffset,
PRUint32  aCutLength,
const char *  aData,
PRUint32  aDataLength = PR_UINT32_MAX 
)

NS_CStringSetDataRange.

This function copies aData into a section of aStr. As a result it can be used to insert new characters into the string.

Parameters:
aStrabstract string reference
aCutOffsetstarting index where the string's existing data is to be overwritten (pass PR_UINT32_MAX to cause aData to be appended to the end of aStr, in which case the value of aCutLength is ignored).
aCutLengthnumber of characters to overwrite starting at aCutOffset (pass PR_UINT32_MAX to overwrite until the end of aStr).
aDatacharacter buffer (pass null to cause this function to simply remove the "cut" range)
aDataLengthnumber of characters to copy from source string (pass PR_UINT32_MAX to copy until end of aData, designated by a null character)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr after copying data from aData. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 367 of file nsXPComStub.cpp.

{
  return NS_CStringSetDataRange_P(aStr, aCutStart, aCutLength, aBuf, aCount);
}

Here is the call graph for this function:

NS_EXPORT nsresult NS_CStringToUTF16 ( const nsACString &  aSource,
nsCStringEncoding  aSrcEncoding,
nsAString &  aDest 
)

NS_CStringToUTF16.

This function converts the characters in a nsACString to an array of UTF-16 characters, in the platform endianness. The result is stored in a nsAString object.

Parameters:
aSourceabstract string reference containing source string
aSrcEncodingcharacter encoding of the source string
aDestabstract string reference to hold the result

FROZEN

Definition at line 382 of file nsXPComStub.cpp.

{
  return NS_CStringToUTF16_P(aSrc, aSrcEncoding, aDest);
}

Here is the call graph for this function:

NS_EXPORT void NS_Free ( void ptr)

Frees a block of memory.

Null is a permissible value, in which case no action is taken.

FROZEN

Parameters:
ptrThe block of memory to free. This block must originally have been allocated by NS_Alloc or NS_Realloc
Note:
This function is thread-safe.

Definition at line 219 of file nsXPComStub.cpp.

{
  NS_Free_P(ptr);
}

Public Method to access to the component manager.

FROZEN

Parameters:
resultInterface pointer to the service
Returns:
NS_OK for success; other error codes indicate a failure during initialisation.

Definition at line 152 of file nsXPComStub.cpp.

{
  return NS_GetComponentManager_P(result);
}

Here is the caller graph for this function:

Public Method to access to the component registration manager.

FROZEN

Parameters:
resultInterface pointer to the service
Returns:
NS_OK for success; other error codes indicate a failure during initialisation.

Definition at line 159 of file nsXPComStub.cpp.

{
  return NS_GetComponentRegistrar_P(result);
}

Here is the caller graph for this function:

Definition at line 191 of file nsXPComStub.cpp.

{
  return NS_GetDebug_P(result);
}

Here is the caller graph for this function:

Definition at line 92 of file nsXPComStub.cpp.

{
    if (!functions)
        return NS_ERROR_OUT_OF_MEMORY;

    if (functions->version != XPCOM_GLUE_VERSION)
        return NS_ERROR_FAILURE;

    PRUint32 size = functions->size;
    if (size > sizeof(XPCOMFunctions))
        size = sizeof(XPCOMFunctions);

    size -= offsetof(XPCOMFunctions, init);

    memcpy(&functions->init, &kFrozenFunctions.init, size);

    return NS_OK;
}

Here is the call graph for this function:

Public Method to access to the memory manager.

See nsIMemory

FROZEN

Parameters:
resultInterface pointer to the memory manager
Returns:
NS_OK for success; other error codes indicate a failure during initialisation.

Definition at line 166 of file nsXPComStub.cpp.

{
  return NS_GetMemoryManager_P(result);
}

Here is the call graph for this function:

Public Method to access to the service manager.

FROZEN

Parameters:
resultInterface pointer to the service manager
Returns:
NS_OK for success; other error codes indicate a failure during initialisation.

Definition at line 145 of file nsXPComStub.cpp.

{
  return NS_GetServiceManager_P(result);
}

Here is the caller graph for this function:

Definition at line 198 of file nsXPComStub.cpp.

{
  return NS_GetTraceRefcnt_P(result);
}

Here is the caller graph for this function:

NS_EXPORT nsresult NS_InitXPCOM2 ( nsIServiceManager **  result,
nsIFile binDirectory,
nsIDirectoryServiceProvider appFileLocationProvider 
)

Initialises XPCOM.

You must call one of the NS_InitXPCOM methods before proceeding to use xpcom. The one exception is that you may call NS_NewLocalFile to create a nsIFile.

FROZEN

Note:
Use NS_NewLocalFile or NS_NewNativeLocalFile to create the file object you supply as the bin directory path in this call. The function may be safely called before the rest of XPCOM or embedding has been initialised.
Parameters:
resultThe service manager. You may pass null.
binDirectoryThe directory containing the component registry and runtime libraries; or use nsnull to use the working directory.
appFileLocationProviderThe object to be used by Gecko that specifies to Gecko where to find profiles, the component registry preferences and so on; or use nsnull for the default behaviour.
See also:
NS_NewLocalFile
nsILocalFile
nsIDirectoryServiceProvider
Returns:
NS_OK for success; NS_ERROR_NOT_INITIALIZED if static globals were not initialized, which can happen if XPCOM is reloaded, but did not completly shutdown. Other error codes indicate a failure during initialisation.

Definition at line 117 of file nsXPComStub.cpp.

{
  return NS_InitXPCOM2_P(result, binDirectory, dirProvider);
}

Here is the caller graph for this function:

NS_EXPORT nsresult NS_InitXPCOM3 ( nsIServiceManager **  result,
nsIFile binDirectory,
nsIDirectoryServiceProvider appFileLocationProvider,
nsStaticModuleInfo const staticComponents,
PRUint32  componentCount 
)

Initialises XPCOM with static components.

You must call one of the NS_InitXPCOM methods before proceeding to use xpcom. The one exception is that you may call NS_NewLocalFile to create a nsIFile.

FROZEN

Note:
Use NS_NewLocalFile or NS_NewNativeLocalFile to create the file object you supply as the bin directory path in this call. The function may be safely called before the rest of XPCOM or embedding has been initialised.
Parameters:
resultThe service manager. You may pass null.
binDirectoryThe directory containing the component registry and runtime libraries; or use nsnull to use the working directory.
appFileLocationProviderThe object to be used by Gecko that specifies to Gecko where to find profiles, the component registry preferences and so on; or use nsnull for the default behaviour.
staticComponentsAn array of static components. Passing null causes default (builtin) components to be registered, if present.
componentCountNumber of elements in staticComponents
See also:
NS_NewLocalFile
nsILocalFile
nsIDirectoryServiceProvider
XRE_GetStaticComponents
Returns:
NS_OK for success; NS_ERROR_NOT_INITIALIZED if static globals were not initialized, which can happen if XPCOM is reloaded, but did not completly shutdown. Other error codes indicate a failure during initialisation.

Definition at line 126 of file nsXPComStub.cpp.

{
  return NS_InitXPCOM3_P(result, binDirectory, dirProvider,
                         staticComponents, componentCount);
}

Here is the caller graph for this function:

NS_EXPORT nsresult NS_NewLocalFile ( const nsAString &  path,
PRBool  followLinks,
nsILocalFile **  result 
)

Public Method to create an instance of a nsILocalFile.

This function may be called prior to NS_InitXPCOM.

FROZEN

Parameters:
pathA string which specifies a full file path to a location. Relative paths will be treated as an error (NS_ERROR_FILE_UNRECOGNIZED_PATH). |NS_NewNativeLocalFile|'s path must be in the filesystem charset.
followLinksThis attribute will determine if the nsLocalFile will auto resolve symbolic links. By default, this value will be false on all non unix systems. On unix, this attribute is effectively a noop.
resultInterface pointer to a new instance of an nsILocalFile
Returns:
NS_OK for success; other error codes indicate a failure.

Definition at line 173 of file nsXPComStub.cpp.

{
  return NS_NewLocalFile_P(path, followLinks, result);
}

Here is the caller graph for this function:

NS_EXPORT nsresult NS_NewNativeLocalFile ( const nsACString &  path,
PRBool  followLinks,
nsILocalFile **  result 
)

Definition at line 182 of file nsXPComStub.cpp.

{
  return NS_NewNativeLocalFile_P(path, followLinks, result);
}
NS_EXPORT void* NS_Realloc ( void ptr,
PRSize  size 
)

Reallocates a block of memory to a new size.

FROZEN

Parameters:
ptrThe block of memory to reallocate. This block must originally have been allocated by NS_Alloc or NS_Realloc
sizeThe new size. If 0, frees the block like NS_Free
Returns:
The reallocated block of memory
Note:
This function is thread-safe.

If ptr is null, this function behaves like NS_Alloc. If s is the size of the block to which ptr points, the first min(s, size) bytes of ptr's block are copied to the new block. If the allocation succeeds, ptr is freed and a pointer to the new block is returned. If the allocation fails, ptr is not freed and null is returned. The returned value may be the same as ptr.

Definition at line 212 of file nsXPComStub.cpp.

{
  return NS_Realloc_P(ptr, size);
}

Definition at line 230 of file nsXPComStub.cpp.

{
  return NS_RegisterXPCOMExitRoutine_P(exitRoutine, priority);
}

Here is the call graph for this function:

Shutdown XPCOM.

You must call this method after you are finished using xpcom.

FROZEN

Parameters:
servMgrThe service manager which was returned by NS_InitXPCOM. This will release servMgr. You may pass null.
Returns:
NS_OK for success; other error codes indicate a failure during initialisation.

Definition at line 138 of file nsXPComStub.cpp.

{
  return NS_ShutdownXPCOM_P(svcMgr);
}

Here is the caller graph for this function:

NS_EXPORT PRUnichar* NS_StringCloneData ( const nsAString &  aStr)

NS_StringCloneData.

This function returns a null-terminated copy of the string's internal buffer.

Parameters:
aStrabstract string reference
Returns:
null-terminated copy of the string's internal buffer (it must be free'd using using nsMemory::Free)

FROZEN

Definition at line 286 of file nsXPComStub.cpp.

{
  return NS_StringCloneData_P(aStr);
}

Here is the call graph for this function:

NS_StringContainerFinish.

Parameters:
aContainerstring container reference

This function frees any memory owned by aContainer.

FROZEN

Definition at line 265 of file nsXPComStub.cpp.

{
  NS_StringContainerFinish_P(aStr);
}

NS_StringContainerInit.

Parameters:
aContainerstring container reference
Returns:
NS_OK if string container successfully initialized

This function may allocate additional memory for aContainer. When aContainer is no longer needed, NS_StringContainerFinish should be called.

FROZEN

Definition at line 248 of file nsXPComStub.cpp.

{
  return NS_StringContainerInit_P(aStr);
}

Here is the call graph for this function:

NS_EXPORT nsresult NS_StringContainerInit2 ( nsStringContainer aContainer,
const PRUnichar aData = nsnull,
PRUint32  aDataLength = PR_UINT32_MAX,
PRUint32  aFlags = 0 
)

NS_StringContainerInit2.

Parameters:
aContainerstring container reference
aDatacharacter buffer (may be null)
aDataLengthnumber of characters stored at aData (may pass PR_UINT32_MAX if aData is null-terminated)
aFlagsflags affecting how the string container is initialized. this parameter is ignored when aData is null. otherwise, if this parameter is 0, then aData is copied into the string.

This function resembles NS_StringContainerInit but provides further options that permit more efficient memory usage. When aContainer is no longer needed, NS_StringContainerFinish should be called.

NOTE: NS_StringContainerInit2(container, nsnull, 0, 0) is equivalent to NS_StringContainerInit(container).

FROZEN

Definition at line 255 of file nsXPComStub.cpp.

{   
  return NS_StringContainerInit2_P(aStr, aData, aDataLength, aFlags);
}

Here is the call graph for this function:

NS_EXPORT nsresult NS_StringCopy ( nsAString &  aDestStr,
const nsAString &  aSrcStr 
)

NS_StringCopy.

This function makes aDestStr have the same value as aSrcStr. It is provided as an optimization.

Parameters:
aDestStrabstract string reference to be modified
aSrcStrabstract string reference containing source string
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aDestStr after copying data from aSrcStr. The behavior depends on the implementation of the abstract string, aDestStr. If aDestStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 308 of file nsXPComStub.cpp.

{
  return NS_StringCopy_P(aDest, aSrc);
}
NS_EXPORT PRUint32 NS_StringGetData ( const nsAString &  aStr,
const PRUnichar **  aData,
PRBool aTerminated = nsnull 
)

NS_StringGetData.

This function returns a const character pointer to the string's internal buffer, the length of the string, and a boolean value indicating whether or not the buffer is null-terminated.

Parameters:
aStrabstract string reference
aDataout param that will hold the address of aStr's internal buffer
aTerminatedif non-null, this out param will be set to indicate whether or not aStr's internal buffer is null- terminated
Returns:
length of aStr's internal buffer

FROZEN

Definition at line 272 of file nsXPComStub.cpp.

{
  return NS_StringGetData_P(aStr, aBuf, aTerm);
}
NS_EXPORT PRUint32 NS_StringGetMutableData ( nsAString &  aStr,
PRUint32  aDataLength,
PRUnichar **  aData 
)

NS_StringGetMutableData.

This function provides mutable access to a string's internal buffer. It returns a pointer to an array of characters that may be modified. The returned pointer remains valid until the string object is passed to some other string function.

Optionally, this function may be used to resize the string's internal buffer. The aDataLength parameter specifies the requested length of the string's internal buffer. By passing some value other than PR_UINT32_MAX, the caller can request that the buffer be resized to the specified number of characters before returning. The caller is not responsible for writing a null-terminator.

Parameters:
aStrabstract string reference
aDataLengthnumber of characters to resize the string's internal buffer to or PR_UINT32_MAX if no resizing is needed
aDataout param that upon return holds the address of aStr's internal buffer or null if the function failed
Returns:
number of characters or zero if the function failed

This function does not necessarily null-terminate aStr after resizing its internal buffer. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 279 of file nsXPComStub.cpp.

{
  return NS_StringGetMutableData_P(aStr, aLen, aBuf);
}
NS_EXPORT nsresult NS_StringSetData ( nsAString &  aStr,
const PRUnichar aData,
PRUint32  aDataLength = PR_UINT32_MAX 
)

NS_StringSetData.

This function copies aData into aStr.

Parameters:
aStrabstract string reference
aDatacharacter buffer
aDataLengthnumber of characters to copy from source string (pass PR_UINT32_MAX to copy until end of aData, designated by a null character)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr after copying data from aData. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 293 of file nsXPComStub.cpp.

{
  return NS_StringSetData_P(aStr, aBuf, aCount);
}
NS_EXPORT nsresult NS_StringSetDataRange ( nsAString &  aStr,
PRUint32  aCutOffset,
PRUint32  aCutLength,
const PRUnichar aData,
PRUint32  aDataLength = PR_UINT32_MAX 
)

NS_StringSetDataRange.

This function copies aData into a section of aStr. As a result it can be used to insert new characters into the string.

Parameters:
aStrabstract string reference
aCutOffsetstarting index where the string's existing data is to be overwritten (pass PR_UINT32_MAX to cause aData to be appended to the end of aStr, in which case the value of aCutLength is ignored).
aCutLengthnumber of characters to overwrite starting at aCutOffset (pass PR_UINT32_MAX to overwrite until the end of aStr).
aDatacharacter buffer (pass null to cause this function to simply remove the "cut" range)
aDataLengthnumber of characters to copy from source string (pass PR_UINT32_MAX to copy until end of aData, designated by a null character)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr after copying data from aData. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null-terminated by this function.

FROZEN

Definition at line 300 of file nsXPComStub.cpp.

{
  return NS_StringSetDataRange_P(aStr, aCutStart, aCutLength, aBuf, aCount);
}

Here is the call graph for this function:

Definition at line 237 of file nsXPComStub.cpp.

{
  return NS_UnregisterXPCOMExitRoutine_P(exitRoutine);
}
NS_EXPORT nsresult NS_UTF16ToCString ( const nsAString &  aSource,
nsCStringEncoding  aDestEncoding,
nsACString &  aDest 
)

NS_UTF16ToCString.

This function converts the UTF-16 characters in a nsAString to a single-byte encoding. The result is stored in a nsACString object. In some cases this conversion may be lossy. In such cases, the conversion may succeed with a return code indicating loss of information. The exact behavior is not specified at this time.

Parameters:
aSourceabstract string reference containing source string
aDestEncodingcharacter encoding of the resulting string
aDestabstract string reference to hold the result

FROZEN

Definition at line 389 of file nsXPComStub.cpp.

{
  return NS_UTF16ToCString_P(aSrc, aDestEncoding, aDest);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 44 of file nsXPComStub.cpp.