mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 07:08:11 +00:00
Add attributes for classes in the XML file generated by the genapixml tool to tell whether a class is refcountable and/or destroyable.
This commit is contained in:
parent
867a5a90f6
commit
03a7fe29fd
1 changed files with 24 additions and 1 deletions
|
|
@ -593,7 +593,30 @@ class Generator:
|
|||
functionNode.append(f.detailedDescription)
|
||||
|
||||
def __generateClass(self, cclass, classesNode):
|
||||
classNodeAttributes = { 'name' : cclass.name, 'cfunctionprefix' : cclass.cFunctionPrefix, 'deprecated' : str(cclass.deprecated).lower() }
|
||||
has_ref_method = False
|
||||
has_unref_method = False
|
||||
has_destroy_method = False
|
||||
for methodname in cclass.instanceMethods:
|
||||
methodname_without_prefix = methodname.replace(cclass.cFunctionPrefix, '')
|
||||
if methodname_without_prefix == 'ref':
|
||||
has_ref_method = True
|
||||
elif methodname_without_prefix == 'unref':
|
||||
has_unref_method = True
|
||||
elif methodname_without_prefix == 'destroy':
|
||||
has_destroy_method = True
|
||||
refcountable = False
|
||||
destroyable = False
|
||||
if has_ref_method and has_unref_method:
|
||||
refcountable = True
|
||||
if has_destroy_method:
|
||||
destroyable = True
|
||||
classNodeAttributes = {
|
||||
'name' : cclass.name,
|
||||
'cfunctionprefix' : cclass.cFunctionPrefix,
|
||||
'deprecated' : str(cclass.deprecated).lower(),
|
||||
'refcountable' : str(refcountable).lower(),
|
||||
'destroyable' : str(destroyable).lower()
|
||||
}
|
||||
classNode = ET.SubElement(classesNode, 'class', classNodeAttributes)
|
||||
if len(cclass.events) > 0:
|
||||
eventsNode = ET.SubElement(classNode, 'events')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue