Main Page   Compound List   File List   Compound Members   File Members  

TclXPCOMInterfaceUtils.cpp File Reference

#include "TclXPCOMPrivate.h"

Go to the source code of this file.

Functions

void * CloneMemory (void *ptr, size_t size)
int TclXPCOM_CheckInterfaceIsReflectable (Tcl_Interp *interp, nsIInterfaceInfo *interfaceinfo, int flags)
int TclXPCOM_CheckMethodIsReflectable (Tcl_Interp *interp, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, int flags)
int isInInterface (nsIInterfaceInfo *interfaceinfo, nsIID *iid)
Tcl_Obj * TclXPCOM_ListInterfaceConstants (nsIInterfaceInfo *interfaceinfo)
Tcl_Obj * TclXPCOM_ListInterfaceAttributes (nsIInterfaceInfo *interfaceinfo)
Tcl_Obj * TclXPCOM_ListInterfaceMethods (nsIInterfaceInfo *interfaceinfo)
Tcl_Obj * TclXPCOM_ListClassMethods (ClassInfo *cinfo)
Tcl_Obj * TclXPCOM_ListClassAttributes (ClassInfo *cinfo)
Tcl_Obj * GetType (nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, nsXPTParamInfo *paraminfo, nsXPTType type)
Tcl_Obj * GetParam (nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, nsXPTParamInfo *paraminfo)
Tcl_Obj * TclXPCOM_ListMethodArguments (nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex)
Tcl_Obj * TclXPCOM_GetReturnValueType (nsIInterfaceInfo *interfaceinfo, IdentifierInfo *idinfo)
Tcl_Obj * TclXPCOM_GetAttributeType (nsIInterfaceInfo *interfaceinfo, IdentifierInfo *idinfo)


Detailed Description

Contains various utility functions for interface introspection.

Definition in file TclXPCOMInterfaceUtils.cpp.


Function Documentation

void* CloneMemory void *    ptr,
size_t    size
 

Duplicates a chunk of memory using the XPCOM memory manager.

Returns:
an allocated copy of the given memory chunk
Parameters:
ptr  (in) memory to clone
size  (in) size of chunk

Definition at line 50 of file TclXPCOMInterfaceUtils.cpp.

int TclXPCOM_CheckInterfaceIsReflectable Tcl_Interp *    interp,
nsIInterfaceInfo *    interfaceinfo,
int    flags
 

Verifies that an interface is reflectable into TclXPCOM (is marked 'scriptable' in the IDL file). If it is not reflectable, an error message will be set in the given interpreter. If the 'FORCE_NOTSCRIPTABLE' bit is set in 'flags', then no error will be generated even if the interface is not reflectable.

Return values:
TCL_OK  - if the interface is reflectable
TCL_ERROR  - if the interface is not reflectable
Parameters:
interp  (in) interpreter to store error message
interfaceinfo  (in) interface to verify
flags  (in) override flags

Definition at line 75 of file TclXPCOMInterfaceUtils.cpp.

References FORCE_HIDDEN, FORCE_NOTSCRIPTABLE, and FORCE_NOTXPCOM.

int TclXPCOM_CheckMethodIsReflectable Tcl_Interp *    interp,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
int    flags
 

Verifies that a method is reflectable into TclXPCOM (is not marked 'noscript' or 'notxpcom' in the IDL file). If it is not reflectable, an error message will be set in the given interpreter. The 'FORCE_HIDDEN' and 'FORCE_NOTXPCOM' bits in 'flags' will override any 'noscript' or 'notxpcom' marked methods, respectively, forcing a successful return.

Return values:
TCL_OK  - if the method is reflectable
TCL_ERROR  - if the method is not reflectable
Parameters:
interp  (in) interpreter to store error message
interfaceinfo  (in) interface of method to verify
methodindex  (in) index into interface of method to verify
flags  (in) override flags

Definition at line 115 of file TclXPCOMInterfaceUtils.cpp.

References FORCE_HIDDEN, FORCE_NOTSCRIPTABLE, and FORCE_NOTXPCOM.

int isInInterface nsIInterfaceInfo *    interfaceinfo,
nsIID *    iid
 

Determines whether an interface specified by 'iid' is an ancestor of the interface specified by 'interfaceinfo', or if 'iid' and 'interfaceinfo' refer to the same interface.

Return values:
1  - if 'iid' is equal to or an ancestor of 'interfaceinfo'
0  - if 'iid' is not in 'interfaceinfo'
Parameters:
interfaceinfo  (in) interfaceinfo of interface
iid  (in) iid of interface to check

Definition at line 160 of file TclXPCOMInterfaceUtils.cpp.

Tcl_Obj* TclXPCOM_ListInterfaceConstants nsIInterfaceInfo *    interfaceinfo
 

Lists the constants of an interface and its ancestors.

Returns:
a Tcl list of constant names
Parameters:
interfaceinfo  (in) interface to search

Definition at line 189 of file TclXPCOMInterfaceUtils.cpp.

References InterfaceInfo::constantcount, InterfaceInfo::constantnames, and GetInterfaceInfo.

Tcl_Obj* TclXPCOM_ListInterfaceAttributes nsIInterfaceInfo *    interfaceinfo
 

Lists the attributes of an interface and its ancestors.

Returns:
a Tcl list of attribute names
Parameters:
interfaceinfo  (in) interface to search

Definition at line 217 of file TclXPCOMInterfaceUtils.cpp.

References InterfaceInfo::attributecount, InterfaceInfo::attributes, GetInterfaceInfo, and IdentifierInfo_::name.

Tcl_Obj* TclXPCOM_ListInterfaceMethods nsIInterfaceInfo *    interfaceinfo
 

Lists the methods of an interface and its ancestors.

Returns:
a Tcl list of method names
Parameters:
interfaceinfo  (in) interface to search

Definition at line 245 of file TclXPCOMInterfaceUtils.cpp.

References GetInterfaceInfo, InterfaceInfo::methodcount, InterfaceInfo::methods, and IdentifierInfo_::name.

Tcl_Obj* TclXPCOM_ListClassMethods ClassInfo   cinfo
 

Lists the methods associated with a set of interfaces composing a class. Any ambiguous method names will be qualified with their corresponding interface name.

Returns:
a Tcl list of method names
Parameters:
cinfo  (in) class to search

Definition at line 275 of file TclXPCOMInterfaceUtils.cpp.

References ClassIdentifierInfo::idinfo, ClassInfo_::methodcount, ClassInfo_::methods, and IdentifierInfo_::name.

Tcl_Obj* TclXPCOM_ListClassAttributes ClassInfo   cinfo
 

Lists the attributes associated with a set of interfaces composing a class. Any ambiguous attribute names will be qualified with their corresponding interface name.

Returns:
a Tcl list of attribute names
Parameters:
cinfo  (in) class to search

Definition at line 302 of file TclXPCOMInterfaceUtils.cpp.

References ClassInfo_::attributecount, ClassInfo_::attributes, ClassIdentifierInfo::idinfo, and IdentifierInfo_::name.

Tcl_Obj* GetType nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
nsXPTParamInfo *    paraminfo,
nsXPTType    type
 

Determines the string representation of the type of a given parameter. If the parameter is an array, a list will be returned whose first element is 'list' followed by the type of values in the array.

Returns:
a new Tcl object with refcount 0 holding the string representation of the method parameter's type.
Parameters:
interfaceinfo  (in) interface to query
methodindex  (in) index of method
paraminfo  (in) xpt parameter info structure of parameter
type  (in) xpt type structure of parameter

Definition at line 331 of file TclXPCOMInterfaceUtils.cpp.

Referenced by GetParam, TclXPCOM_GetAttributeType, and TclXPCOM_GetReturnValueType.

Tcl_Obj* GetParam nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
nsXPTParamInfo *    paraminfo
 

Determines the string representation of a method parameter. It's representation consists of a list whose first element is the direction of the parameter (in, out, or inout) followed by the type of the parameter.

Returns:
a new Tcl object with refcount 0 holding the string representation of the method parameter.
Parameters:
interfaceinfo  (in) interface information of method
methodindex  (in) index into interface for method
paraminfo  (in) xpt parameter info structure of parameter

Definition at line 465 of file TclXPCOMInterfaceUtils.cpp.

References GetType.

Referenced by TclXPCOM_ListMethodArguments.

Tcl_Obj* TclXPCOM_ListMethodArguments nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex
 

Lists the types of a method's arguments.

Returns:
a new Tcl object with refcount 0 holding a list of the method's argument types.
Parameters:
interfaceinfo  (in) interface information for method
methodindex  (in) index into interface for method

Definition at line 506 of file TclXPCOMInterfaceUtils.cpp.

References GetMethodInfo, GetParam, PARAM_IS_RETVAL, PARAM_IS_SKIPPED, MethodInfo::paramcount, MethodInfo::paraminfos, and MethodInfo::tclparams.

Tcl_Obj* TclXPCOM_GetReturnValueType nsIInterfaceInfo *    interfaceinfo,
IdentifierInfo   idinfo
 

Determines the type of a method's return value.

Returns:
a new Tcl object with refcount 0 holding the string representation of the method's return value
Parameters:
interfaceinfo  (in) interface information for method
idinfo  (in) identifier information for method

Definition at line 545 of file TclXPCOMInterfaceUtils.cpp.

References GetMethodInfo, GetType, IdentifierInfo_::indices, PARAM_IS_RETVAL, MethodInfo::paramcount, MethodInfo::paraminfos, and MethodInfo::tclparams.

Tcl_Obj* TclXPCOM_GetAttributeType nsIInterfaceInfo *    interfaceinfo,
IdentifierInfo   idinfo
 

Determines the type of an attribute.

Returns:
a new Tcl object with refcount 0 holding the string representation of the attribute's type
Parameters:
interfaceinfo  (in) interface information for the attribute
idinfo  (in) indentifier information for the attribute

Definition at line 582 of file TclXPCOMInterfaceUtils.cpp.

References GetMethodInfo, GetType, IdentifierInfo_::indices, INTERFACEINFO_GETTER, MethodInfo::paraminfos, MethodInfo::tclparams, and IdentifierInfo_::type.


Generated on Fri Jun 14 23:25:51 2002 for TclXPCOM by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002