Back to index

lightning-sunbird  0.9+nobinonly
Functions
XPCDispInlines.h File Reference

inline implementations Implementations for inline members of classes found in DispPrivate.h More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const nsIIDXPCDispIID2nsIID (const IID &iid)
const IID & XPCDispIID2IID (const nsIID &iid)
const nsCIDXPCDispCLSID2nsCID (const CLSID &clsid)
const CLSID & XPCDispnsCID2CLSID (const nsCID &clsid)
jscharxpc_JSString2String (JSContext *cx, jsval val, PRUint32 *len=0)
 Converts a jsval that is a string to a char const *.
PRUnicharxpc_JSString2PRUnichar (XPCCallContext &ccx, jsval val, size_t *length=nsnull)
 Converts a jsval that is a string to a PRUnichar *.

Detailed Description

inline implementations Implementations for inline members of classes found in DispPrivate.h

Definition in file XPCDispInlines.h.


Function Documentation

PRUnichar* xpc_JSString2PRUnichar ( XPCCallContext ccx,
jsval  val,
size_t *  length = nsnull 
) [inline]

Converts a jsval that is a string to a PRUnichar *.

Parameters:
cxa JS context
valthe JS value to vbe converted
lengthoptional pointer to a variable to hold the length
Returns:
a PRUnichar buffer (Does not need to be freed)

Definition at line 664 of file XPCDispInlines.h.

Here is the call graph for this function:

Here is the caller graph for this function:

jschar* xpc_JSString2String ( JSContext cx,
jsval  val,
PRUint32 len = 0 
) [inline]

Converts a jsval that is a string to a char const *.

Parameters:
cxa JS context
valThe JS value to be converted
Returns:
a C string (Does not need to be freed)

Definition at line 641 of file XPCDispInlines.h.

{
    JSString* str = JSVAL_IS_STRING(val) ? JSVAL_TO_STRING(val) : 
                                           JS_ValueToString(cx, val);
    if(str)
    {
        if(len)
            *len = JS_GetStringLength(str);
        return JS_GetStringChars(str);
    }
    if(len)
        *len = 0;
    return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const nsCID& XPCDispCLSID2nsCID ( const CLSID &  clsid) [inline]

Definition at line 577 of file XPCDispInlines.h.

{
    NS_ASSERTION(sizeof(CLSID) == sizeof(nsCID), "CLSID is not the same size as nsCID");
    return NS_REINTERPRET_CAST(const nsCID &,clsid);
}

Here is the caller graph for this function:

const IID& XPCDispIID2IID ( const nsIID iid) [inline]

Definition at line 570 of file XPCDispInlines.h.

{
    NS_ASSERTION(sizeof(IID) == sizeof(nsIID), "IID is not the same size as nsIID");
    return NS_REINTERPRET_CAST(const IID &, iid);
}
const nsIID& XPCDispIID2nsIID ( const IID &  iid) [inline]

Definition at line 563 of file XPCDispInlines.h.

{
    NS_ASSERTION(sizeof(IID) == sizeof(nsIID), "IID is not the same size as nsIID");
    return NS_REINTERPRET_CAST(const nsIID &,iid);
}

Here is the caller graph for this function:

const CLSID& XPCDispnsCID2CLSID ( const nsCID clsid) [inline]

Definition at line 584 of file XPCDispInlines.h.

{
    NS_ASSERTION(sizeof(CLSID) == sizeof(nsCID), "CLSID is not the same size as nsCID");
    return NS_REINTERPRET_CAST(const CLSID &, clsid);
}