26 #ifndef SBHASHTABLEUTILS_H_
27 #define SBHASHTABLEUTILS_H_
29 #include <nsIMutableArray.h>
30 #include <nsDataHashtable.h>
38 typename T::DataType
aData,
41 NS_ASSERTION(userArg,
"ArrayBuilder passed a null arg");
42 typename T::Hashtable * table =
reinterpret_cast<typename T::Hashtable*
>(userArg);
44 PRBool added = table->Put(aKey, aData);
45 NS_ENSURE_TRUE(added, PL_DHASH_STOP);
66 typename T::Hashtable & aDest)
68 aSource.EnumerateRead(&HashCopierEnumerator<T>,
81 NS_ASSERTION(userArg,
"ArrayBuilder passed a null arg");
82 nsIMutableArray*
array =
83 reinterpret_cast<nsIMutableArray*
>(userArg);
85 nsresult rv = array->AppendElement(aKey->GetKey(), PR_FALSE);
86 NS_ENSURE_SUCCESS(rv, PL_DHASH_STOP);
96 nsIMutableArray* aDest)
98 NS_ENSURE_ARG_POINTER(aDest);
100 aSource.EnumerateEntries(&THashCOMPtrCopierToIArrayEnumerator<T>,
nsresult sbCopyHashtable(typename T::Hashtable const &aSource, typename T::Hashtable &aDest)
PLDHashOperator THashCOMPtrCopierToIArrayEnumerator(E *aKey, void *userArg)
nsresult sbCopyHashtableToArray(class nsTHashtable< T > &aSource, nsIMutableArray *aDest)
PLDHashOperator HashCopierEnumerator(typename T::KeyType aKey, typename T::DataType aData, void *userArg)
_updateTextAndScrollDataForFrame aData