mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-27 13:16:21 +00:00
Simplified java wrapper
This commit is contained in:
parent
036cd8a5d8
commit
12df1381bc
2 changed files with 1 additions and 19 deletions
|
|
@ -191,20 +191,11 @@ class JavaTranslator(object):
|
||||||
methodDict['params'] += self.translate_argument(arg)
|
methodDict['params'] += self.translate_argument(arg)
|
||||||
methodDict['native_params'] += self.translate_argument(arg, True)
|
methodDict['native_params'] += self.translate_argument(arg, True)
|
||||||
methodDict['static_native_params'] += self.translate_argument(arg, True)
|
methodDict['static_native_params'] += self.translate_argument(arg, True)
|
||||||
if type(arg.type) is AbsApi.ListType:
|
if type(arg.type) is AbsApi.EnumType:
|
||||||
if type(arg.type.containedTypeDesc) is AbsApi.ClassType:
|
|
||||||
methodDict['convertInputClassArrayToLongArray'] = True
|
|
||||||
methodDict['native_params_impl_list_param_name'] = self.translate_argument_name(arg.name)
|
|
||||||
methodDict['native_params_impl_list_param_type'] = self.translate_type(arg.type.containedTypeDesc) + 'Impl'
|
|
||||||
methodDict['native_params_impl'] += 'longArray'
|
|
||||||
else:
|
|
||||||
methodDict['native_params_impl'] += self.translate_argument_name(arg.name)
|
|
||||||
elif type(arg.type) is AbsApi.EnumType:
|
|
||||||
methodDict['native_params_impl'] += self.translate_argument_name(arg.name) + '.toInt()'
|
methodDict['native_params_impl'] += self.translate_argument_name(arg.name) + '.toInt()'
|
||||||
else:
|
else:
|
||||||
methodDict['native_params_impl'] += self.translate_argument_name(arg.name)
|
methodDict['native_params_impl'] += self.translate_argument_name(arg.name)
|
||||||
|
|
||||||
methodDict['classicMethod'] = not methodDict['convertInputClassArrayToLongArray']
|
|
||||||
methodDict['deprecated'] = _method.deprecated
|
methodDict['deprecated'] = _method.deprecated
|
||||||
methodDict['doc'] = self.docTranslator.translate(_method.briefDescription) if _method.briefDescription is not None else None
|
methodDict['doc'] = self.docTranslator.translate(_method.briefDescription) if _method.briefDescription is not None else None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,17 +128,8 @@ class {{classImplName}} implements {{className}} {
|
||||||
{{#methods}}
|
{{#methods}}
|
||||||
private native {{return_native}} {{name}}({{native_params}});
|
private native {{return_native}} {{name}}({{native_params}});
|
||||||
public {{return}} {{name}}({{params}}) {{#exception}}throws CoreException{{/exception}} {
|
public {{return}} {{name}}({{params}}) {{#exception}}throws CoreException{{/exception}} {
|
||||||
{{#convertInputClassArrayToLongArray}}
|
|
||||||
long[] longArray = new long[{{native_params_impl_list_param_name}}.length];
|
|
||||||
for (int i=0; i < {{native_params_impl_list_param_name}}.length; i++) {
|
|
||||||
longArray[i] = (({{native_params_impl_list_param_type}}){{native_params_impl_list_param_name}}[i]).nativePtr;
|
|
||||||
}
|
|
||||||
{{name}}(nativePtr{{native_params_impl}});
|
|
||||||
{{/convertInputClassArrayToLongArray}}
|
|
||||||
{{#classicMethod}}
|
|
||||||
{{#exception}}int exceptionResult = {{/exception}}{{return_keyword}}{{#enumCast}}{{return}}.fromInt({{/enumCast}}{{#classCast}}({{return}}){{/classCast}}{{name}}(nativePtr{{native_params_impl}}){{#enumCast}}){{/enumCast}};
|
{{#exception}}int exceptionResult = {{/exception}}{{return_keyword}}{{#enumCast}}{{return}}.fromInt({{/enumCast}}{{#classCast}}({{return}}){{/classCast}}{{name}}(nativePtr{{native_params_impl}}){{#enumCast}}){{/enumCast}};
|
||||||
{{#exception}}if (exceptionResult != 0) throw new CoreException("{{name}} returned value " + exceptionResult){{/exception}}
|
{{#exception}}if (exceptionResult != 0) throw new CoreException("{{name}} returned value " + exceptionResult){{/exception}}
|
||||||
{{/classicMethod}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/methods}}
|
{{/methods}}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue