Back to index

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

List of all members.

Public Member Functions

def __init__
def IsGetter
def IsSetter
def IsNotXPCOM
def IsConstructor
def IsHidden
def Describe_Python
def Describe

Public Attributes

 interface_info
 method_index
 result_desc
 params

Detailed Description

Definition at line 171 of file xpt.py.


Constructor & Destructor Documentation

def xpcom.xpt.Method.__init__ (   self,
  method_info,
  method_index,
  interface_info = None 
)

Definition at line 173 of file xpt.py.

00173 
00174     def __init__(self, method_info, method_index, interface_info = None):
00175         self.interface_info = interface_info
00176         self.method_index = method_index
00177         self.flags, self.name, param_descs, self.result_desc = method_info
00178         # Build the params.
00179         self.params = []
00180         pi=0
00181         for pd in param_descs:
00182             self.params.append( Parameter(pd, pi, method_index, interface_info) )
00183             pi = pi + 1
00184         # Run over the params setting the "sizeof" params to hidden.
00185         for p in self.params:
00186             td = p.type_desc
00187             tag = XPT_TDP_TAG(td[0])
00188             if tag==T_ARRAY and p.IsIn():
00189                 self.params[td[1]].hidden_indicator = 2
00190             elif tag in [T_PSTRING_SIZE_IS, T_PWSTRING_SIZE_IS] and p.IsIn():
00191                 self.params[td[1]].hidden_indicator = 1


Member Function Documentation

def xpcom.xpt.Method.Describe (   self)

Definition at line 236 of file xpt.py.

00236 
00237     def Describe(self):
00238         s = ''
00239         if self.IsGetter():
00240             G = 'G'
00241         else:
00242             G = ' '
00243         if self.IsSetter():
00244             S = 'S'
00245         else: S = ' '
00246         if self.IsHidden():
00247             H = 'H'
00248         else:
00249             H = ' '
00250         if self.IsNotXPCOM():
00251             N = 'N'
00252         else:
00253             N = ' '
00254         if self.IsConstructor():
00255             C = 'C'
00256         else:
00257             C = ' '
00258 
00259         def desc(a): return a.Describe()
00260         method_desc = string.join(map(desc, self.params), ', ')
00261         result_type = TypeDescriber(self.result_desc[0], None)
00262         return_desc = result_type.Describe()
00263         i = string.find(return_desc, 'retval ')
00264         if i != -1:
00265             return_desc = return_desc[:i] + return_desc[i+len('retval '):]
00266         return G+S+H+N+C+' '+return_desc+' '+self.name + '('+ method_desc + ');'

Here is the call graph for this function:

Definition at line 203 of file xpt.py.

00203 
00204     def Describe_Python(self):
00205         if self.method_index < 3: # Ignore QI etc
00206             return ""
00207         base_name = self.name
00208         if self.IsGetter():
00209             name = "get_%s" % (base_name,)
00210         elif self.IsSetter():
00211             name = "set_%s" % (base_name,)
00212         else:
00213             name = base_name
00214         param_decls = ["self"]
00215         in_comments = []
00216         out_descs = []
00217         result_comment = "Result: void - None"
00218         for p in self.params:
00219             in_desc, in_desc_comments, out_desc, this_result_comment = p.Describe_Python()
00220             if in_desc is not None:
00221                 param_decls.append(in_desc)
00222             if in_desc_comments is not None:
00223                 in_comments.append(in_desc_comments)
00224             if out_desc is not None:
00225                 out_descs.append(out_desc)
00226             if this_result_comment is not None:
00227                 result_comment = this_result_comment
00228         joiner = "\n        # "
00229         in_comment = out_desc = ""
00230         if in_comments: in_comment = joiner + joiner.join(in_comments)
00231         if out_descs: out_desc = joiner + joiner.join(out_descs)
00232 
00233         return """    def %s( %s ):
00234         # %s%s%s
00235         pass""" % (name, ", ".join(param_decls), result_comment, in_comment, out_desc)

Here is the call graph for this function:

Definition at line 198 of file xpt.py.

00198 
00199     def IsConstructor(self):
        return (self.flags & XPT_MD_CTOR)

Here is the call graph for this function:

Here is the caller graph for this function:

def xpcom.xpt.Method.IsGetter (   self)

Definition at line 192 of file xpt.py.

00192 
00193     def IsGetter(self):
        return (self.flags & XPT_MD_GETTER)

Here is the call graph for this function:

Here is the caller graph for this function:

def xpcom.xpt.Method.IsHidden (   self)

Definition at line 200 of file xpt.py.

00200 
00201     def IsHidden(self):
00202         return (self.flags & XPT_MD_HIDDEN)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 196 of file xpt.py.

00196 
00197     def IsNotXPCOM(self):
        return (self.flags & XPT_MD_NOTXPCOM)

Here is the call graph for this function:

Here is the caller graph for this function:

def xpcom.xpt.Method.IsSetter (   self)

Definition at line 194 of file xpt.py.

00194 
00195     def IsSetter(self):
        return (self.flags & XPT_MD_SETTER)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 174 of file xpt.py.

Definition at line 175 of file xpt.py.

Definition at line 178 of file xpt.py.

Definition at line 176 of file xpt.py.


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