Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
xpcom.xpt.TypeDescriber Class Reference

List of all members.

Public Member Functions

def __init__
def IsPointer
def IsUniquePointer
def IsReference
def repr_for_invoke
def GetName
def Describe

Public Attributes

 type_flags
 tag
 param

Detailed Description

Definition at line 373 of file xpt.py.


Constructor & Destructor Documentation

def xpcom.xpt.TypeDescriber.__init__ (   self,
  type_flags,
  param 
)

Definition at line 374 of file xpt.py.

00374 
00375     def __init__(self, type_flags, param):
00376         self.type_flags = type_flags
00377         self.tag = XPT_TDP_TAG(self.type_flags)
        self.param = param

Member Function Documentation

Definition at line 401 of file xpt.py.

00401 
00402     def Describe(self):
00403         if self.tag == T_ARRAY:
00404             # NOTE - Adding a type specifier to the array is different from xpt_dump.exe
00405             if self.param is None or self.param.interface_info is None:
00406                 type_desc = "" # Dont have explicit info about the array type :-(
00407             else:
00408                 i_info = self.param.interface_info
00409                 type_code = i_info.GetTypeForParam(self.param.method_index, self.param.param_index, 1)
00410                 type_desc = TypeDescriber( type_code[0], None).Describe()
00411             return self.GetName() + "[" + type_desc + "]" 
00412         elif self.tag == T_INTERFACE:
00413             if self.param is None or self.param.interface_info is None:
00414                 return "nsISomething" # Dont have explicit info about the IID :-(
00415             i_info = self.param.interface_info
00416             m_index = self.param.method_index
00417             p_index = self.param.param_index
00418             try:
00419                 iid = i_info.GetIIDForParam(m_index, p_index)
00420                 return iid.name
00421             except xpcom.Exception:
00422                 return "nsISomething"
00423         return self.GetName()
00424 
00425 # These are just for output purposes, so should be
# the same as xpt_dump uses

Definition at line 386 of file xpt.py.

00386 
00387     def GetName(self):
00388         is_ptr = self.IsPointer()
00389         data = type_info_map.get(self.tag)
00390         if data is None:
00391             data = ("unknown",)
00392         if self.IsReference():
00393             if len(data) > 2:
00394                 return data[2]
00395             return data[0] + " &"
00396         if self.IsPointer():
00397             if len(data)>1:
00398                 return data[1]
00399             return data[0] + " *"
00400         return data[0]

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 378 of file xpt.py.

00378 
00379     def IsPointer(self):
        return XPT_TDP_IS_POINTER(self.type_flags)

Here is the caller graph for this function:

Definition at line 382 of file xpt.py.

00382 
00383     def IsReference(self):
        return XPT_TDP_IS_REFERENCE(self.type_flags)

Here is the caller graph for this function:

Definition at line 380 of file xpt.py.

Definition at line 384 of file xpt.py.

00384 
00385     def repr_for_invoke(self):
        return (self.type_flags,)

Member Data Documentation

Definition at line 377 of file xpt.py.

Definition at line 376 of file xpt.py.

Definition at line 375 of file xpt.py.


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