forked from mirrors/linphone-iphone
Added brief doc to C# wrapper
This commit is contained in:
parent
4f3129d810
commit
b5f095738d
4 changed files with 28 additions and 4 deletions
|
|
@ -80,5 +80,5 @@ class DoxygenCppTranslator(Translator):
|
|||
class SandcastleCSharpTranslator(Translator):
|
||||
def _tag_as_brief(self, lines):
|
||||
if len(lines) > 0:
|
||||
lines[0] = '<summary>' + lines[0]
|
||||
lines[-1] = lines[-1] + '</summary>'
|
||||
lines.insert(0, '<summary>')
|
||||
lines.append('</summary>')
|
||||
|
|
|
|||
|
|
@ -455,8 +455,8 @@ class CParser(object):
|
|||
'linphone_vcard_get_belcard'] # manualy wrapped
|
||||
|
||||
self.classBl = ['LpConfig',
|
||||
'LinphonePlayer',
|
||||
'LinphoneCoreVTable',] # temporarly blacklisted
|
||||
'LinphoneCoreVTable',
|
||||
'LinphonePlayer'] # temporarly blacklisted
|
||||
|
||||
# list of classes that must be concidered as refcountable even if
|
||||
# they are no ref()/unref() methods
|
||||
|
|
@ -585,6 +585,7 @@ class CParser(object):
|
|||
name = EnumName()
|
||||
name.from_camel_case(nameStr, namespace=self.namespace.name)
|
||||
enum = Enum(name)
|
||||
enum.briefDescription = cenum.briefDoc
|
||||
self.namespace.add_child(enum)
|
||||
|
||||
for cEnumValue in cenum.values:
|
||||
|
|
@ -618,6 +619,7 @@ class CParser(object):
|
|||
name = ClassName()
|
||||
name.from_camel_case(cclass.name, namespace=self.namespace.name)
|
||||
_class = Class(name)
|
||||
_class.briefDescription = cclass.briefDoc
|
||||
_class.refcountable = self._class_is_refcountable(cclass)
|
||||
|
||||
for cproperty in cclass.properties.values():
|
||||
|
|
@ -685,6 +687,7 @@ class CParser(object):
|
|||
raise Error('{0} is not a listener'.format(cclass.name))
|
||||
|
||||
listener = Interface(name)
|
||||
listener.briefDescription = cclass.briefDoc
|
||||
|
||||
for property in cclass.properties.values():
|
||||
if property.name != 'user_data':
|
||||
|
|
@ -732,6 +735,7 @@ class CParser(object):
|
|||
raise BlacklistedException('{0} is blacklisted'.format(name.to_c()));
|
||||
|
||||
method = Method(name, type=type)
|
||||
method.briefDescription = cfunction.briefDoc
|
||||
method.deprecated = cfunction.deprecated
|
||||
method.returnType = self.parse_type(cfunction.returnArgument)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools'))
|
|||
print sys.path
|
||||
import genapixml as CApi
|
||||
import abstractapi as AbsApi
|
||||
import metadoc
|
||||
|
||||
class CsharpTranslator(object):
|
||||
def __init__(self):
|
||||
self.ignore = []
|
||||
self.docTranslator = metadoc.SandcastleCSharpTranslator()
|
||||
|
||||
def init_method_dict(self):
|
||||
methodDict = {}
|
||||
|
|
@ -180,6 +182,8 @@ class CsharpTranslator(object):
|
|||
methodDict = {}
|
||||
methodDict['prototype'] = "static extern {return} {name}({params});".format(**methodElems)
|
||||
|
||||
methodDict['doc'] = self.docTranslator.translate(method.briefDescription) if method.briefDescription is not None else None
|
||||
|
||||
methodDict['has_impl'] = genImpl
|
||||
if genImpl:
|
||||
methodDict['impl'] = {}
|
||||
|
|
@ -427,6 +431,7 @@ class CsharpTranslator(object):
|
|||
def translate_enum(self, enum):
|
||||
enumDict = {}
|
||||
enumDict['enumName'] = enum.name.to_camel_case()
|
||||
enumDict['doc'] = self.docTranslator.translate(enum.briefDescription) if enum.briefDescription is not None else None
|
||||
enumDict['values'] = []
|
||||
i = 0
|
||||
lastValue = None
|
||||
|
|
|
|||
|
|
@ -191,6 +191,11 @@ namespace Linphone
|
|||
#region Enums
|
||||
{{#enums}}
|
||||
{{#enum}}
|
||||
{{#doc}}
|
||||
{{#lines}}
|
||||
/// {{{line}}}
|
||||
{{/lines}}
|
||||
{{/doc}}
|
||||
public enum {{enumName}}
|
||||
{
|
||||
{{#values}}
|
||||
|
|
@ -273,6 +278,11 @@ namespace Linphone
|
|||
{{/has_second_prototype}}
|
||||
|
||||
{{#has_property}}
|
||||
{{#doc}}
|
||||
{{#lines}}
|
||||
/// {{{line}}}
|
||||
{{/lines}}
|
||||
{{/doc}}
|
||||
{{property_static}}public {{{property_return}}} {{property_name}}
|
||||
{
|
||||
{{#has_getter}}
|
||||
|
|
@ -340,6 +350,11 @@ namespace Linphone
|
|||
{{/has_property}}
|
||||
{{#has_impl}}
|
||||
{{#impl}}
|
||||
{{#doc}}
|
||||
{{#lines}}
|
||||
/// {{{line}}}
|
||||
{{/lines}}
|
||||
{{/doc}}
|
||||
public {{static}}{{override}}{{{type}}} {{name}}({{{args}}})
|
||||
{
|
||||
{{#is_string}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue