diff --git a/tools/genapixml.py b/tools/genapixml.py index f2c1fd555..d52d92f09 100755 --- a/tools/genapixml.py +++ b/tools/genapixml.py @@ -336,13 +336,17 @@ class Project: if td.definition.startswith('struct '): for st in self.__structs: if st.associatedTypedef == td: - self.add(CClass(st)) + cclass = CClass(st) + cclass.briefDoc = td.briefDoc + self.add(cclass) break elif ('Linphone' + td.definition) == td.name: st = CStruct(td.name) st.associatedTypedef = td + cclass = CClass(st) + cclass.briefDoc = td.briefDoc 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 self.classes.sort(key = lambda c: len(c.name), reverse = True) for e in self.__events: @@ -497,6 +501,7 @@ class Project: if deprecatedNode is not None: f.deprecated = True f.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip() + f.briefDoc = metadoc.Description(node.find('./briefdescription')) f.detailedDescription = self.__cleanDescription(node.find('./detaileddescription')) return f else: @@ -508,6 +513,7 @@ class Project: if deprecatedNode is not None: td.deprecated = True td.briefDescription = ''.join(node.find('./briefdescription').itertext()).strip() + td.briefDoc = metadoc.Description(node.find('./briefdescription')) td.detailedDescription = self.__cleanDescription(node.find('./detaileddescription')) return td return None diff --git a/wrappers/cpp/class_header.mustache b/wrappers/cpp/class_header.mustache index e6c447914..6e4e94876 100644 --- a/wrappers/cpp/class_header.mustache +++ b/wrappers/cpp/class_header.mustache @@ -44,6 +44,13 @@ namespace linphone { {{/priorDeclarations}} {{#_class}} + {{#doc}} + /** + {{#lines}} + * {{{line}}} + {{/lines}} + */ + {{/doc}} class {{className}}{{#parentClassName}}: public {{{parentClassName}}}{{/parentClassName}} { {{#friendClasses}} friend class {{name}}; diff --git a/wrappers/cpp/genwrapper.py b/wrappers/cpp/genwrapper.py index 2c11f967e..c7b42f591 100755 --- a/wrappers/cpp/genwrapper.py +++ b/wrappers/cpp/genwrapper.py @@ -95,6 +95,8 @@ class CppTranslator(object): if _class.name.to_c() == 'LinphoneCore': classDict['friendClasses'].append({'name': 'Factory'}); + classDict['doc'] = self.docTranslator.translate(_class.briefDescription) + if islistenable: classDict['listenerClassName'] = CppTranslator.translate_class_name(_class.listenerInterface.name) classDict['cListenerName'] = _class.listenerInterface.name.to_c()