Back to index

lightning-sunbird  0.9+nobinonly
Classes | Typedefs | Functions
nsScriptableInterfaceInfo.cpp File Reference
#include "iixprivate.h"

Go to the source code of this file.

Classes

class  nsScriptableDataType
class  nsScriptableParamInfo
class  nsScriptableConstant
class  nsScriptableMethodInfo

Typedefs

typedef PRBool(* InfoTester )(nsIInterfaceInfoManager *manager, const void *data, nsIInterfaceInfo **info)

Functions

static nsresult CloneString (const char *inStr, char **outStr)
static PRBool IIDTester (nsIInterfaceInfoManager *manager, const void *data, nsIInterfaceInfo **info)
static PRBool NameTester (nsIInterfaceInfoManager *manager, const void *data, nsIInterfaceInfo **info)
static nsresult FindInfo (InfoTester tester, const void *data, nsIInterfaceInfo **info)

Typedef Documentation

Definition at line 530 of file nsScriptableInterfaceInfo.cpp.


Function Documentation

static nsresult CloneString ( const char *  inStr,
char **  outStr 
) [inline, static]

Definition at line 45 of file nsScriptableInterfaceInfo.cpp.

{
    *outStr = (char*) nsMemory::Clone(inStr, strlen(inStr)+1);
    return *outStr ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

Here is the call graph for this function:

static nsresult FindInfo ( InfoTester  tester,
const void data,
nsIInterfaceInfo **  info 
) [static]

Definition at line 550 of file nsScriptableInterfaceInfo.cpp.

{
    nsCOMPtr<nsIInterfaceInfoManager> iim = 
        dont_AddRef(XPTI_GetInterfaceInfoManager());
    
    if(!iim)
        return NS_ERROR_UNEXPECTED;

    if(tester(iim, data, info))
        return NS_OK;
    
    // If not found, then let's ask additional managers.

    PRBool yes;
    nsCOMPtr<nsISimpleEnumerator> list;
    nsCOMPtr<nsIInterfaceInfoSuperManager> iism;

    if((nsnull != (iism = do_QueryInterface(iim))) &&
       NS_SUCCEEDED(iism->HasAdditionalManagers(&yes)) && yes &&
       NS_SUCCEEDED(iism->EnumerateAdditionalManagers(getter_AddRefs(list))) &&
       list)
    {
        PRBool more;
        nsCOMPtr<nsIInterfaceInfoManager> current;

        while(NS_SUCCEEDED(list->HasMoreElements(&more)) && more &&
              NS_SUCCEEDED(list->GetNext(getter_AddRefs(current))) && current)
        {
            if(tester(current, data, info))
                return NS_OK;
        }
    }
    
    return NS_ERROR_NO_INTERFACE;
}    

Here is the call graph for this function:

static PRBool IIDTester ( nsIInterfaceInfoManager manager,
const void data,
nsIInterfaceInfo **  info 
) [static]

Definition at line 534 of file nsScriptableInterfaceInfo.cpp.

{
    return NS_SUCCEEDED(manager->GetInfoForIID((const nsIID *) data, info)) &&
           *info;
}
static PRBool NameTester ( nsIInterfaceInfoManager manager,
const void data,
nsIInterfaceInfo **  info 
) [static]

Definition at line 542 of file nsScriptableInterfaceInfo.cpp.

{
    return NS_SUCCEEDED(manager->GetInfoForName((const char *) data, info)) &&
           *info;
}