mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
C++ wrapper: add a Doxygen brief description above class declarations
This commit is contained in:
parent
28b257a873
commit
0a2ea96a1e
3 changed files with 17 additions and 2 deletions
|
|
@ -336,13 +336,17 @@ class Project:
|
||||||
if td.definition.startswith('struct '):
|
if td.definition.startswith('struct '):
|
||||||
for st in self.__structs:
|
for st in self.__structs:
|
||||||
if st.associatedTypedef == td:
|
if st.associatedTypedef == td:
|
||||||
self.add(CClass(st))
|
cclass = CClass(st)
|
||||||
|
cclass.briefDoc = td.briefDoc
|
||||||
|
self.add(cclass)
|
||||||
break
|
break
|
||||||
elif ('Linphone' + td.definition) == td.name:
|
elif ('Linphone' + td.definition) == td.name:
|
||||||
st = CStruct(td.name)
|
st = CStruct(td.name)
|
||||||
st.associatedTypedef = td
|
st.associatedTypedef = td
|
||||||
|
cclass = CClass(st)
|
||||||
|
cclass.briefDoc = td.briefDoc
|
||||||
self.add(st)
|
self.add(st)
|
||||||
self.add(CClass(st))
|
self.add(cclass)
|
||||||
# Sort classes by length of name (longest first), so that methods are put in the right class
|
# Sort classes by length of name (longest first), so that methods are put in the right class
|
||||||
self.classes.sort(key = lambda c: len(c.name), reverse = True)
|
self.classes.sort(key = lambda c: len(c.name), reverse = True)
|
||||||
for e in self.__events:
|
for e in self.__events:
|
||||||
|
|
@ -497,6 +501,7 @@ class Project:
|
||||||
if deprecatedNode is not None:
|
if deprecatedNode is not None:
|
||||||
f.deprecated = True
|
f.deprecated = True
|
||||||
f.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip()
|
f.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip()
|
||||||
|
f.briefDoc = metadoc.Description(node.find('./briefdescription'))
|
||||||
f.detailedDescription = self.__cleanDescription(node.find('./detaileddescription'))
|
f.detailedDescription = self.__cleanDescription(node.find('./detaileddescription'))
|
||||||
return f
|
return f
|
||||||
else:
|
else:
|
||||||
|
|
@ -508,6 +513,7 @@ class Project:
|
||||||
if deprecatedNode is not None:
|
if deprecatedNode is not None:
|
||||||
td.deprecated = True
|
td.deprecated = True
|
||||||
td.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip()
|
td.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip()
|
||||||
|
td.briefDoc = metadoc.Description(node.find('./briefdescription'))
|
||||||
td.detailedDescription = self.__cleanDescription(node.find('./detaileddescription'))
|
td.detailedDescription = self.__cleanDescription(node.find('./detaileddescription'))
|
||||||
return td
|
return td
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,13 @@ namespace linphone {
|
||||||
{{/priorDeclarations}}
|
{{/priorDeclarations}}
|
||||||
|
|
||||||
{{#_class}}
|
{{#_class}}
|
||||||
|
{{#doc}}
|
||||||
|
/**
|
||||||
|
{{#lines}}
|
||||||
|
* {{{line}}}
|
||||||
|
{{/lines}}
|
||||||
|
*/
|
||||||
|
{{/doc}}
|
||||||
class {{className}}{{#parentClassName}}: public {{{parentClassName}}}{{/parentClassName}} {
|
class {{className}}{{#parentClassName}}: public {{{parentClassName}}}{{/parentClassName}} {
|
||||||
{{#friendClasses}}
|
{{#friendClasses}}
|
||||||
friend class {{name}};
|
friend class {{name}};
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,8 @@ class CppTranslator(object):
|
||||||
if _class.name.to_c() == 'LinphoneCore':
|
if _class.name.to_c() == 'LinphoneCore':
|
||||||
classDict['friendClasses'].append({'name': 'Factory'});
|
classDict['friendClasses'].append({'name': 'Factory'});
|
||||||
|
|
||||||
|
classDict['doc'] = self.docTranslator.translate(_class.briefDescription)
|
||||||
|
|
||||||
if islistenable:
|
if islistenable:
|
||||||
classDict['listenerClassName'] = CppTranslator.translate_class_name(_class.listenerInterface.name)
|
classDict['listenerClassName'] = CppTranslator.translate_class_name(_class.listenerInterface.name)
|
||||||
classDict['cListenerName'] = _class.listenerInterface.name.to_c()
|
classDict['cListenerName'] = _class.listenerInterface.name.to_c()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue