@@ -196,14 +196,24 @@ class Function(Declaration):
196196 '''The declaration of a function.
197197 @ivar _result: instance of L{Type} or None.
198198 @ivar _parameters: list of L{Type} instances.
199+ @ivar _throws: exception specifiers or None
199200 '''
200201
201- def __init__ (self , name , namespace , result , params ):
202+ def __init__ (self , name , namespace , result , params , throws = None ):
202203 Declaration .__init__ (self , name , namespace )
203204 # the result type: instance of Type, or None (constructors)
204205 self .result = result
205206 # the parameters: instances of Type
206207 self .parameters = params
208+ # the exception specification
209+ self .throws = throws
210+
211+
212+ def Exceptions (self ):
213+ if self .throws is None :
214+ return ""
215+ else :
216+ return " throw(%s)" % ', ' .join (self .throws )
207217
208218
209219 def PointerDeclaration (self , force = False ):
@@ -264,10 +274,11 @@ class Method(Function):
264274 @ivar _static: if this method is static.
265275 @ivar _class: the full name of the class where this method was declared.
266276 @ivar _const: if this method is declared as const.
277+ @ivar _throws: list of exception specificiers or None
267278 '''
268279
269- def __init__ (self , name , class_ , result , params , visib , virtual , abstract , static , const ):
270- Function .__init__ (self , name , None , result , params )
280+ def __init__ (self , name , class_ , result , params , visib , virtual , abstract , static , const , throws = None ):
281+ Function .__init__ (self , name , None , result , params , throws )
271282 self .visibility = visib
272283 self .virtual = virtual
273284 self .abstract = abstract
@@ -296,8 +307,8 @@ def PointerDeclaration(self, force=False):
296307 const = ''
297308 if self .const :
298309 const = 'const'
299- return '(%s (%s::*)(%s) %s)&%s' % \
300- (result , self .class_ , params , const , self .FullName ())
310+ return '(%s (%s::*)(%s) %s%s )&%s' % \
311+ (result , self .class_ , params , const , self .Exceptions (), self . FullName ())
301312
302313
303314#==============================================================================
0 commit comments