nsIStringService

IID:1e66d70c-d649-441b-ac90-bf6429ead7da
Inherits From:nsISupports
Status:This interface has been removed from newer versions

nsIStringService - A factory for nsAString and nsACString objects.

UNDER_REVIEW


Methods

nsACString* createACString ( char* string , PRInt32 length ) nsAString* createAString ( PRUnichar* string , PRInt32 length ) void deleteACString ( nsACString* string ) void deleteAString ( nsAString* string ) char* getString ( ACString string ) PRUnichar* getWString ( AString string )

nsACString* createACString ( char* string , PRInt32 length )

Creates an nsAString from a char buffer and lenth.

Must be destroyed by deleteACString();

Arguments:
string: : A string assigned to the new nsACString
length: : The length of the string to be assigned to the new nsACString

nsAString* createAString ( PRUnichar* string , PRInt32 length )

Creates an nsAString from a PRUnichar buffer and length.

Must be destroyed by deleteAString();

Arguments:
string: : A unicode string assigned to the new nsAString
length: : The length of the string to be assigned to the new nsAString

void deleteACString ( nsACString* string )

Frees memory associated with the nsACString. After calling this method, the string is no longer valid.

Arguments:
string: : The |nsACString| object.

void deleteAString ( nsAString* string )

Frees memory associated with the nsAString. After calling this method, the string is no longer valid.

Arguments:
string: : The |nsAString| object.

char* getString ( ACString string )

Returns a new char buffer containing the bytes of string. This new buffer may contain embedded null characters. The length of this new buffer is given by string.Length().

Allocates and returns a new char buffer which you must free with nsMemory::Free.

Arguments:
string: : The |nsACString| object.
Returns:
a new |char| buffer you must free with |nsMemory::Free|.

PRUnichar* getWString ( AString string )

Returns a new PRUnichar buffer containing the bytes of string. This new buffer may contain embedded null characters. The length of this new buffer is given by string.Length().

Allocates and returns a new char buffer which you must free with nsMemory::Free.

Arguments:
string: : The |nsAString| object.
Returns:
a new |PRUnichar| buffer you must free with |nsMemory::Free|.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available
Add a note

Copyright © 1999 - 2005 XULPlanet.com