Public Member Functions | Static Public Member Functions

nsPropertyTable Class Reference

#include <nsPropertyTable.h>

List of all members.

Public Member Functions

void * GetProperty (nsPropertyOwner aObject, nsIAtom *aPropertyName, nsresult *aResult=0)
 Get the value of the property |aPropertyName| for node |aObject|.
void * GetProperty (nsPropertyOwner aObject, PRUint16 aCategory, nsIAtom *aPropertyName, nsresult *aResult=0)
nsresult SetProperty (nsPropertyOwner aObject, nsIAtom *aPropertyName, void *aPropertyValue, NSPropertyDtorFunc aDtor, void *aDtorData, PRBool aTransfer=0, void **aOldValue=0)
 Set the value of the property |aPropertyName| in the global category to |aPropertyValue| for node |aObject|.
nsresult SetProperty (nsPropertyOwner aObject, PRUint16 aCategory, nsIAtom *aPropertyName, void *aPropertyValue, NSPropertyDtorFunc aDtor, void *aDtorData, PRBool aTransfer=0, void **aOldValue=0)
 Set the value of the property |aPropertyName| in the category |aCategory| to |aPropertyValue| for node |aObject|.
nsresult DeleteProperty (nsPropertyOwner aObject, nsIAtom *aPropertyName)
 Delete the property |aPropertyName| in the global category for object |aObject|.
nsresult DeleteProperty (nsPropertyOwner aObject, PRUint16 aCategory, nsIAtom *aPropertyName)
 Delete the property |aPropertyName| in category |aCategory| for object |aObject|.
void * UnsetProperty (nsPropertyOwner aObject, nsIAtom *aPropertyName, nsresult *aStatus=0)
 Unset the property |aPropertyName| in the global category for object |aObject|, but do not call the property's destructor function.
void * UnsetProperty (nsPropertyOwner aObject, PRUint16 aCategory, nsIAtom *aPropertyName, nsresult *aStatus=0)
 Unset the property |aPropertyName| in category |aCategory| for object |aObject|, but do not call the property's destructor function.
void DeleteAllPropertiesFor (nsPropertyOwner aObject)
 Deletes all of the properties for object |aObject|, calling the destructor function for each property.
void DeleteAllPropertiesFor (nsPropertyOwner aObject, PRUint16 aCategory)
 Deletes all of the properties in category |aCategory| for object |aObject|, calling the destructor function for each property.
nsresult TransferOrDeleteAllPropertiesFor (nsPropertyOwner aObject, nsPropertyTable *aOtherTable)
 Transfers all properties for object |aObject| that were set with the |aTransfer| argument as PR_TRUE to |aTable|.
void Enumerate (nsPropertyOwner aObject, PRUint16 aCategory, NSPropertyFunc aCallback, void *aData)
 Enumerate the properties in category |aCategory| for object |aObject|.
void DeleteAllProperties ()
 Deletes all of the properties for all objects in the property table, calling the destructor function for each property.
 ~nsPropertyTable ()

Static Public Member Functions

static void SupportsDtorFunc (void *aObject, nsIAtom *aPropertyName, void *aPropertyValue, void *aData)
 Function useable as destructor function for property data that is XPCOM objects.

Constructor & Destructor Documentation

nsPropertyTable::~nsPropertyTable (  )  [inline]

Member Function Documentation

void nsPropertyTable::DeleteAllProperties (  ) 

Deletes all of the properties for all objects in the property table, calling the destructor function for each property.

void nsPropertyTable::DeleteAllPropertiesFor ( nsPropertyOwner  aObject,
PRUint16  aCategory 
)

Deletes all of the properties in category |aCategory| for object |aObject|, calling the destructor function for each property.

void nsPropertyTable::DeleteAllPropertiesFor ( nsPropertyOwner  aObject  ) 

Deletes all of the properties for object |aObject|, calling the destructor function for each property.

nsresult nsPropertyTable::DeleteProperty ( nsPropertyOwner  aObject,
nsIAtom aPropertyName 
) [inline]

Delete the property |aPropertyName| in the global category for object |aObject|.

The property's destructor function will be called.

nsresult nsPropertyTable::DeleteProperty ( nsPropertyOwner  aObject,
PRUint16  aCategory,
nsIAtom aPropertyName 
)

Delete the property |aPropertyName| in category |aCategory| for object |aObject|.

The property's destructor function will be called.

void nsPropertyTable::Enumerate ( nsPropertyOwner  aObject,
PRUint16  aCategory,
NSPropertyFunc  aCallback,
void *  aData 
)

Enumerate the properties in category |aCategory| for object |aObject|.

For every property |aCallback| will be called with as arguments |aObject|, the property name, the property value and |aData|.

void* nsPropertyTable::GetProperty ( nsPropertyOwner  aObject,
nsIAtom aPropertyName,
nsresult aResult = 0 
) [inline]

Get the value of the property |aPropertyName| for node |aObject|.

|aResult|, if supplied, is filled in with a return status code.

void* nsPropertyTable::GetProperty ( nsPropertyOwner  aObject,
PRUint16  aCategory,
nsIAtom aPropertyName,
nsresult aResult = 0 
) [inline]
nsresult nsPropertyTable::SetProperty ( nsPropertyOwner  aObject,
nsIAtom aPropertyName,
void *  aPropertyValue,
NSPropertyDtorFunc  aDtor,
void *  aDtorData,
PRBool  aTransfer = 0,
void **  aOldValue = 0 
) [inline]

Set the value of the property |aPropertyName| in the global category to |aPropertyValue| for node |aObject|.

|aDtor| is a destructor for the property value to be called if the property is removed. It can be null if no destructor is required. |aDtorData| is an optional pointer to an opaque context to be passed to the property destructor. Note that the destructor is global for each property name regardless of node; it is an error to set a given property with a different destructor than was used before (this will return NS_ERROR_INVALID_ARG). If aOldValue is non-null it will contain the old value after the function returns (the destructor for the old value will not be run in that case). If |aTransfer| is PR_TRUE the property will be transfered to the new table when the property table for |aObject| changes (currently the tables for nodes are owned by their ownerDocument, so if the ownerDocument for a node changes, its property table changes too). If |aTransfer| is PR_FALSE the property will just be deleted instead.

nsresult nsPropertyTable::SetProperty ( nsPropertyOwner  aObject,
PRUint16  aCategory,
nsIAtom aPropertyName,
void *  aPropertyValue,
NSPropertyDtorFunc  aDtor,
void *  aDtorData,
PRBool  aTransfer = 0,
void **  aOldValue = 0 
) [inline]

Set the value of the property |aPropertyName| in the category |aCategory| to |aPropertyValue| for node |aObject|.

|aDtor| is a destructor for the property value to be called if the property is removed. It can be null if no destructor is required. |aDtorData| is an optional pointer to an opaque context to be passed to the property destructor. Note that the destructor is global for each property name regardless of node; it is an error to set a given property with a different destructor than was used before (this will return NS_ERROR_INVALID_ARG). If aOldValue is non-null it will contain the old value after the function returns (the destructor for the old value will not be run in that case). If aTransfer is PR_TRUE the property will be transfered to the new table when the property table for |aObject| changes (currently the tables for nodes are owned by their ownerDocument, so if the ownerDocument for a node changes, its property table changes too). If |aTransfer| is PR_FALSE the property will just be deleted instead.

static void nsPropertyTable::SupportsDtorFunc ( void *  aObject,
nsIAtom aPropertyName,
void *  aPropertyValue,
void *  aData 
) [static]

Function useable as destructor function for property data that is XPCOM objects.

The function will call NS_IF_RELASE on the value to destroy it.

nsresult nsPropertyTable::TransferOrDeleteAllPropertiesFor ( nsPropertyOwner  aObject,
nsPropertyTable aOtherTable 
)

Transfers all properties for object |aObject| that were set with the |aTransfer| argument as PR_TRUE to |aTable|.

Deletes the other properties for object |aObject|, calling the destructor function for each property. If transfering a property fails, this deletes all the properties for object |aObject|.

void* nsPropertyTable::UnsetProperty ( nsPropertyOwner  aObject,
nsIAtom aPropertyName,
nsresult aStatus = 0 
) [inline]

Unset the property |aPropertyName| in the global category for object |aObject|, but do not call the property's destructor function.

The property value is returned.

void* nsPropertyTable::UnsetProperty ( nsPropertyOwner  aObject,
PRUint16  aCategory,
nsIAtom aPropertyName,
nsresult aStatus = 0 
) [inline]

Unset the property |aPropertyName| in category |aCategory| for object |aObject|, but do not call the property's destructor function.

The property value is returned.


The documentation for this class was generated from the following file: