Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Public Attributes
xpidl.Native Class Reference

List of all members.

Public Member Functions

def __init__
def __eq__
def resolve
def isScriptable
def isPtr
def isRef
def nativeType
def __str__

Public Attributes

 name
 nativename
 location

Static Public Attributes

string kind = 'native'
 modifier = None
 specialtype = None
dictionary specialtypes

Detailed Description

Definition at line 408 of file xpidl.py.


Constructor & Destructor Documentation

def xpidl.Native.__init__ (   self,
  name,
  nativename,
  attlist,
  location 
)

Definition at line 423 of file xpidl.py.

00423 
00424     def __init__(self, name, nativename, attlist, location):
00425         self.name = name
00426         self.nativename = nativename
00427         self.location = location
00428 
00429         for name, value, aloc in attlist:
00430             if value is not None:
00431                 raise IDLError("Unexpected attribute value", aloc)
00432             if name in ('ptr', 'ref'):
00433                 if self.modifier is not None:
00434                     raise IDLError("More than one ptr/ref modifier", aloc)
00435                 self.modifier = name
00436             elif name in self.specialtypes.keys():
00437                 if self.specialtype is not None:
00438                     raise IDLError("More than one special type", aloc)
00439                 self.specialtype = name
00440                 if self.specialtypes[name] is not None:
00441                     self.nativename = self.specialtypes[name]
00442             else:
00443                 raise IDLError("Unexpected attribute", aloc)


Member Function Documentation

def xpidl.Native.__eq__ (   self,
  other 
)

Definition at line 444 of file xpidl.py.

00444 
00445     def __eq__(self, other):
00446         return self.name == other.name and \
00447                self.nativename == other.nativename and \
00448                self.modifier == other.modifier and \
00449                self.specialtype == other.specialtype

def xpidl.Native.__str__ (   self)

Definition at line 485 of file xpidl.py.

00485 
00486     def __str__(self):
00487         return "native %s(%s)\n" % (self.name, self.nativename)

def xpidl.Native.isPtr (   self,
  calltype 
)

Definition at line 462 of file xpidl.py.

00462 
00463     def isPtr(self, calltype):
00464         return self.modifier == 'ptr' or (self.modifier == 'ref' and self.specialtype == 'jsval' and calltype == 'out')

Here is the caller graph for this function:

def xpidl.Native.isRef (   self,
  calltype 
)

Definition at line 465 of file xpidl.py.

00465 
00466     def isRef(self, calltype):
00467         return self.modifier == 'ref' and not (self.specialtype == 'jsval' and calltype == 'out')

Here is the caller graph for this function:

def xpidl.Native.isScriptable (   self)

Definition at line 453 of file xpidl.py.

00453 
00454     def isScriptable(self):
00455         if self.specialtype is None:
00456             return False
00457 
00458         if self.specialtype == 'nsid':
00459             return self.modifier is not None
00460 
00461         return self.modifier == 'ref'

def xpidl.Native.nativeType (   self,
  calltype,
  const = False,
  shared = False 
)

Definition at line 468 of file xpidl.py.

00468 
00469     def nativeType(self, calltype, const=False, shared=False):
00470         if shared:
00471             if calltype != 'out':
00472                 raise IDLError("[shared] only applies to out parameters.")
00473             const = True
00474 
00475         if self.specialtype is not None and calltype == 'in':
00476             const = True
00477 
00478         if self.isRef(calltype):
00479             m = '& '
00480         elif self.isPtr(calltype):
00481             m = '*' + ((self.modifier == 'ptr' and calltype != 'in') and '*' or '')
00482         else:
00483             m = calltype != 'in' and '*' or ''
00484         return "%s%s %s" % (const and 'const ' or '', self.nativename, m)

Here is the call graph for this function:

def xpidl.Native.resolve (   self,
  parent 
)

Definition at line 450 of file xpidl.py.

00450 
00451     def resolve(self, parent):
00452         parent.setName(self)


Member Data Documentation

string xpidl.Native.kind = 'native' [static]

Definition at line 409 of file xpidl.py.

Definition at line 426 of file xpidl.py.

xpidl.Native.modifier = None [static]

Definition at line 411 of file xpidl.py.

Definition at line 424 of file xpidl.py.

Definition at line 425 of file xpidl.py.

xpidl.Native.specialtype = None [static]

Definition at line 412 of file xpidl.py.

dictionary xpidl.Native.specialtypes [static]
Initial value:
{
        'nsid': None,
        'domstring': 'nsAString',
        'utf8string': 'nsACString',
        'cstring': 'nsACString',
        'astring': 'nsAString',
        'jsval': 'JS::Value'
        }

Definition at line 414 of file xpidl.py.


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