sbArrayUtils.h File Reference
#include <algorithm>
#include <nsCOMArray.h>
#include <nsComponentManagerUtils.h>
#include <nsIMutableArray.h>
#include <nsISimpleEnumerator.h>
Include dependency graph for sbArrayUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SB_THREADSAFE_ARRAY_CONTRACTID   "@songbirdnest.com/moz/xpcom/threadsafe-array;1"
 

Functions

template<class T >
nsresult sbCOMArrayTonsIArray (T &aCOMArray, nsIArray **aOutArray)
 
template<class T >
nsresult sbAppendnsCOMArray (T const &aSource, T &aDest, PRUint32 aElementsToCopy=0)
 
nsresult sbAppendnsIArray (nsIArray *aSrc, nsIMutableArray *aDest, PRBool aWeak=PR_FALSE, PRUint32 aElementsToCopy=0)
 
nsresult sbClonensIArray (nsIArray *aSrc, nsIArray **aClonedArray, PRBool aWeak=PR_FALSE)
 
template<class T >
nsresult sbClonensIArray (nsIArray *aSrc, nsCOMArray< T > &aDest)
 

Macro Definition Documentation

#define SB_THREADSAFE_ARRAY_CONTRACTID   "@songbirdnest.com/moz/xpcom/threadsafe-array;1"

Definition at line 40 of file sbArrayUtils.h.

Function Documentation

template<class T >
nsresult sbAppendnsCOMArray ( T const &  aSource,
T &  aDest,
PRUint32  aElementsToCopy = 0 
)

Definition at line 65 of file sbArrayUtils.h.

nsresult sbAppendnsIArray ( nsIArray *  aSrc,
nsIMutableArray *  aDest,
PRBool  aWeak = PR_FALSE,
PRUint32  aElementsToCopy = 0 
)
inline

Clones a nsIArray into a new one

Parameters
aSrc[in] the array to copy from
aDest[in|out] the array to append to
aWeak[in] Whether to store as a weak reference
aElementsToCopy[in] Allows partial appending of source. 0 means copy everything

Definition at line 87 of file sbArrayUtils.h.

Here is the caller graph for this function:

nsresult sbClonensIArray ( nsIArray *  aSrc,
nsIArray **  aClonedArray,
PRBool  aWeak = PR_FALSE 
)
inline

Clones a nsIArray into a new one

Parameters
aSrc[in] the array to clone
aClonedArray[out] the newly created array
aWeak[in] Whether to store as a weak reference

Definition at line 125 of file sbArrayUtils.h.

Here is the call graph for this function:

template<class T >
nsresult sbClonensIArray ( nsIArray *  aSrc,
nsCOMArray< T > &  aDest 
)

Clones a nsIArray into a new nsCOMArray

Parameters
aSrc[in] the array to clone
aDest[inout] the destination array
Exceptions
NS_ERROR_NO_INTERFACEif any element of the source array does not QI into the desired interface. Note that this will modify the destination into an inconsistent state

Definition at line 155 of file sbArrayUtils.h.

template<class T >
nsresult sbCOMArrayTonsIArray ( T &  aCOMArray,
nsIArray **  aOutArray 
)

Definition at line 45 of file sbArrayUtils.h.