sbVariantUtilsLib.cpp File Reference

Songbird Variant Utilities Source. More...

#include "sbVariantUtilsLib.h"
#include <nsCOMPtr.h>
#include <nsStringGlue.h>
#include <iomanip>
#include <sstream>
Include dependency graph for sbVariantUtilsLib.cpp:

Go to the source code of this file.

Functions

static nsresult sbNonStringVariantToInt (nsIVariant *aVariant, PRInt64 *aInt)
 
static nsresult sbNonStringVariantToInt (nsIVariant *aVariant, PRUint64 *aInt)
 
template<class T >
static nsresult sbVariantToInt (nsIVariant *aVariant, T *aInt)
 
nsresult sbVariantsEqual (nsIVariant *aVariant1, nsIVariant *aVariant2, PRBool *aEqual)
 

Detailed Description

Songbird Variant Utilities Source.

Definition in file sbVariantUtilsLib.cpp.

Function Documentation

static nsresult sbNonStringVariantToInt ( nsIVariant *  aVariant,
PRInt64 *  aInt 
)
static

Convert the non-string variant specified by aVariant to an integer and return the result in aInt.

Parameters
aVariantVariant to convert.
aIntReturned integer value.

Definition at line 71 of file sbVariantUtilsLib.cpp.

Here is the caller graph for this function:

static nsresult sbNonStringVariantToInt ( nsIVariant *  aVariant,
PRUint64 *  aInt 
)
static

Definition at line 82 of file sbVariantUtilsLib.cpp.

nsresult sbVariantsEqual ( nsIVariant *  aVariant1,
nsIVariant *  aVariant2,
PRBool *  aEqual 
)

Return true in aEqual if the variant specified by aVariant2 is equal to the variant specified by aVariant1; otherwise, return false. For the comparison, aVariant2 is converted to match the data type of aVariant1. If aVariant1 is an integer, and aVariant2 is a string of the form "0xde10", aVariant2 will be converted as a hexadecimal.

Parameters
aVariant1Variants to compare.
aVariant2
aEqualReturned true if variants are equal.

Definition at line 160 of file sbVariantUtilsLib.cpp.

Here is the call graph for this function:

template<class T >
static nsresult sbVariantToInt ( nsIVariant *  aVariant,
T *  aInt 
)
static

Convert the variant specified by aVariant to an integer and return the result in aInt. If aVariant is a string and of the form "0xde10", it will be converted as a hexadecimal.

Parameters
aVariantVariant to convert.
aIntReturned integer value.

Definition at line 104 of file sbVariantUtilsLib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: