sbNewVariant Class Reference

#include <sbVariantUtils.h>

Public Member Functions

 sbNewVariant ()
 
 sbNewVariant (nsISupports *aValue)
 
 sbNewVariant (REFNSIID aIID, nsISupports *aValue)
 
 sbNewVariant (const nsAString &aValue)
 
 sbNewVariant (const nsACString &aValue, PRUint16 aType=nsIDataType::VTYPE_CSTRING)
 
 sbNewVariant (const char *aValue)
 
 sbNewVariant (char aValue)
 
 sbNewVariant (PRInt16 aValue)
 
 sbNewVariant (PRInt32 aValue)
 
 sbNewVariant (PRUint32 aValue, PRUint16 aType=nsIDataType::VTYPE_UINT32)
 
 sbNewVariant (PRInt64 aValue)
 
 sbNewVariant (PRUint64 aValue)
 
 sbNewVariant (double aValue)
 
nsIVariant * get () const
 
 operator nsIVariant * () const
 

Detailed Description

This class constructs thread-safe nsIVariant objects from simpler data types. The constructors create a null variant on error.

Most constructors create the proper nsIVariant object based upon the data type of the value argument. However, some nsIVariant types have the same C data types (e.g., boolean and UTF8 nsIVariants). For these cases, an extra nsIDataType argument must be provided to the constructor. The following nsIDataTypes must be explicitly specified in the constructor:

VTYPE_UTF8STRING VTYPE_BOOL

Example:

// Get an nsIVariant set with a C-string value. nsCOMPtr<nsIVariant> value = sbNewVariant("Value");

Definition at line 80 of file sbVariantUtils.h.

Constructor & Destructor Documentation

sbNewVariant::sbNewVariant ( )
inline

Definition at line 88 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( nsISupports aValue)
inline

Definition at line 100 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( REFNSIID  aIID,
nsISupports aValue 
)
inline

Definition at line 116 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( const nsAString &  aValue)
inline

Definition at line 132 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( const nsACString &  aValue,
PRUint16  aType = nsIDataType::VTYPE_CSTRING 
)
inline

Definition at line 144 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( const char *  aValue)
inline

Definition at line 161 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( char  aValue)
inline

Definition at line 180 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( PRInt16  aValue)
inline

Definition at line 192 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( PRInt32  aValue)
inline

Definition at line 204 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( PRUint32  aValue,
PRUint16  aType = nsIDataType::VTYPE_UINT32 
)
inline

Definition at line 216 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( PRInt64  aValue)
inline

Definition at line 233 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( PRUint64  aValue)
inline

Definition at line 245 of file sbVariantUtils.h.

sbNewVariant::sbNewVariant ( double  aValue)
inline

Definition at line 257 of file sbVariantUtils.h.

Member Function Documentation

nsIVariant* sbNewVariant::get ( ) const
inline

Return the constructed variant object.

Definition at line 274 of file sbVariantUtils.h.

Here is the caller graph for this function:

sbNewVariant::operator nsIVariant * ( ) const
inline

Definition at line 276 of file sbVariantUtils.h.


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