Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Member Functions
EntryEnumerator Class Reference
Inheritance diagram for EntryEnumerator:
Inheritance graph
[legend]
Collaboration diagram for EntryEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean hasMoreElements ()
 Called to determine whether or not the enumerator has any elements that can be returned via getNext().
nsISupports getNext ()
 Called to retrieve the next element in the enumerator.

Static Public Member Functions

static EntryEnumeratorCreate (nsTHashtable< CategoryLeaf > &aTable)

Protected Member Functions

void Sort ()

Static Protected Member Functions

static int SortCallback (const void *, const void *, void *)

Protected Attributes

const char ** mArray
PRUint32 mCount
PRUint32 mSimpleCurItem
PRUint32 mStringCurItem

Static Private Member Functions

static PLDHashOperator PR_CALLBACK enumfunc_createenumerator (CategoryLeaf *aLeaf, void *userArg)

Detailed Description

Definition at line 185 of file nsCategoryManager.cpp.


Member Function Documentation

Definition at line 207 of file nsCategoryManager.cpp.

{
  EntryEnumerator* enumObj = new EntryEnumerator();
  if (!enumObj)
    return nsnull;

  enumObj->mArray = new char const* [aTable.Count()];
  if (!enumObj->mArray) {
    delete enumObj;
    return nsnull;
  }

  aTable.EnumerateEntries(enumfunc_createenumerator, enumObj);

  enumObj->Sort();

  return enumObj;
}

Here is the call graph for this function:

Definition at line 198 of file nsCategoryManager.cpp.

{
  EntryEnumerator* mythis = NS_STATIC_CAST(EntryEnumerator*, userArg);
  mythis->mArray[mythis->mCount++] = aLeaf->GetKey();

  return PL_DHASH_NEXT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsISupports nsISimpleEnumerator::getNext ( ) [inherited]

Called to retrieve the next element in the enumerator.

The "next" element is the first element upon the first call. Must be pre-ceeded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator.

See also:
hasMoreElements()
Returns:
NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate.
the next element in the enumeration.

Here is the caller graph for this function:

Called to determine whether or not the enumerator has any elements that can be returned via getNext().

This method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getNext() calls. Does not affect internal state of enumerator.

See also:
getNext()
Returns:
PR_TRUE if there are remaining elements in the enumerator. PR_FALSE if there are no more elements in the enumerator.

Here is the caller graph for this function:

void BaseStringEnumerator::Sort ( ) [protected, inherited]

Definition at line 177 of file nsCategoryManager.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int BaseStringEnumerator::SortCallback ( const void e1,
const void e2,
void  
) [static, protected, inherited]

Definition at line 167 of file nsCategoryManager.cpp.

{
  char const *const *s1 = NS_REINTERPRET_CAST(char const *const *, e1);
  char const *const *s2 = NS_REINTERPRET_CAST(char const *const *, e2);

  return strcmp(*s1, *s2);
}

Here is the caller graph for this function:


Member Data Documentation

const char** BaseStringEnumerator::mArray [protected, inherited]

Definition at line 116 of file nsCategoryManager.cpp.

PRUint32 BaseStringEnumerator::mCount [protected, inherited]

Definition at line 117 of file nsCategoryManager.cpp.

Definition at line 118 of file nsCategoryManager.cpp.

Definition at line 119 of file nsCategoryManager.cpp.


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