Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Protected Attributes
nsNameSpaceMap Class Reference

#include <nsNameSpaceMap.h>

Collaboration diagram for nsNameSpaceMap:
Collaboration graph
[legend]

List of all members.

Classes

class  const_iterator
class  Entry

Public Member Functions

 nsNameSpaceMap ()
 ~nsNameSpaceMap ()
nsresult Put (const nsAString &aURI, nsIAtom *aPrefix)
nsresult Put (const nsCSubstring &aURI, nsIAtom *aPrefix)
const_iterator first () const
const_iterator last () const
const_iterator GetNameSpaceOf (const nsCSubstring &aURI) const

Protected Attributes

EntrymEntries

Detailed Description

Definition at line 47 of file nsNameSpaceMap.h.


Constructor & Destructor Documentation

Definition at line 44 of file nsNameSpaceMap.cpp.

Definition at line 50 of file nsNameSpaceMap.cpp.

{
    MOZ_COUNT_DTOR(nsNameSpaceMap);

    while (mEntries) {
        Entry* doomed = mEntries;
        mEntries = mEntries->mNext;
        delete doomed;
    }
}

Member Function Documentation

Definition at line 118 of file nsNameSpaceMap.h.

                                 {
        return const_iterator(mEntries); }

Here is the caller graph for this function:

Definition at line 90 of file nsNameSpaceMap.cpp.

{
    for (Entry* entry = mEntries; entry != nsnull; entry = entry->mNext) {
        if (StringBeginsWith(aURI, entry->mURI))
            return const_iterator(entry);
    }

    return last();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 121 of file nsNameSpaceMap.h.

                                {
        return const_iterator(nsnull); }

Here is the caller graph for this function:

nsresult nsNameSpaceMap::Put ( const nsAString &  aURI,
nsIAtom aPrefix 
)

Definition at line 62 of file nsNameSpaceMap.cpp.

{
    nsCString uriUTF8;
    AppendUTF16toUTF8(aURI, uriUTF8);
    return Put(uriUTF8, aPrefix);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsNameSpaceMap::Put ( const nsCSubstring aURI,
nsIAtom aPrefix 
)

Definition at line 70 of file nsNameSpaceMap.cpp.

{
    Entry* entry;

    // Make sure we're not adding a duplicate
    for (entry = mEntries; entry != nsnull; entry = entry->mNext) {
        if (entry->mURI == aURI || entry->mPrefix == aPrefix)
            return NS_ERROR_FAILURE;
    }

    entry = new Entry(aURI, aPrefix);
    if (! entry)
        return NS_ERROR_OUT_OF_MEMORY;

    entry->mNext = mEntries;
    mEntries = entry;
    return NS_OK;
}

Member Data Documentation

Definition at line 127 of file nsNameSpaceMap.h.


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