Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
txExpandedName Class Reference

#include <XMLUtils.h>

Collaboration diagram for txExpandedName:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 txExpandedName ()
 txExpandedName (PRInt32 aNsID, nsIAtom *aLocalName)
 txExpandedName (const txExpandedName &aOther)
 ~txExpandedName ()
nsresult init (const nsAString &aQName, txNamespaceMap *aResolver, MBool aUseDefault)
void reset ()
PRBool isNull ()
txExpandedNameoperator= (const txExpandedName &rhs)
MBool operator== (const txExpandedName &rhs) const
MBool operator!= (const txExpandedName &rhs) const

Public Attributes

PRInt32 mNamespaceID
nsCOMPtr< nsIAtommLocalName

Detailed Description

Definition at line 59 of file XMLUtils.h.


Constructor & Destructor Documentation

Definition at line 61 of file XMLUtils.h.

txExpandedName::txExpandedName ( PRInt32  aNsID,
nsIAtom aLocalName 
) [inline]

Definition at line 65 of file XMLUtils.h.

                                        : mNamespaceID(aNsID),
                                          mLocalName(aLocalName)
    {
    }

Definition at line 71 of file XMLUtils.h.

Definition at line 77 of file XMLUtils.h.

    {
    }

Member Function Documentation

nsresult txExpandedName::init ( const nsAString &  aQName,
txNamespaceMap aResolver,
MBool  aUseDefault 
)

Definition at line 53 of file XMLUtils.cpp.

{
    const nsAFlatString& qName = PromiseFlatString(aQName);
    const PRUnichar* colon;
    PRBool valid = XMLUtils::isValidQName(qName, &colon);
    if (!valid) {
        return NS_ERROR_FAILURE;
    }

    if (colon) {
        nsCOMPtr<nsIAtom> prefix = do_GetAtom(Substring(qName.get(), colon));
        PRInt32 namespaceID = aResolver->lookupNamespace(prefix);
        if (namespaceID == kNameSpaceID_Unknown)
            return NS_ERROR_FAILURE;
        mNamespaceID = namespaceID;

        const PRUnichar *end;
        qName.EndReading(end);
        mLocalName = do_GetAtom(Substring(colon + 1, end));
    }
    else {
        mNamespaceID = aUseDefault ? aResolver->lookupNamespace(nsnull) :
                                     kNameSpaceID_None;
        mLocalName = do_GetAtom(aQName);
    }
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 90 of file XMLUtils.h.

Here is the caller graph for this function:

MBool txExpandedName::operator!= ( const txExpandedName rhs) const [inline]

Definition at line 108 of file XMLUtils.h.

    {
        return ((mLocalName != rhs.mLocalName) ||
                (mNamespaceID != rhs.mNamespaceID));
    }
txExpandedName& txExpandedName::operator= ( const txExpandedName rhs) [inline]

Definition at line 95 of file XMLUtils.h.

    {
        mNamespaceID = rhs.mNamespaceID;
        mLocalName = rhs.mLocalName;
        return *this;
    }
MBool txExpandedName::operator== ( const txExpandedName rhs) const [inline]

Definition at line 102 of file XMLUtils.h.

    {
        return ((mLocalName == rhs.mLocalName) &&
                (mNamespaceID == rhs.mNamespaceID));
    }

Definition at line 84 of file XMLUtils.h.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 115 of file XMLUtils.h.

Definition at line 114 of file XMLUtils.h.


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