Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
0c3985c0
Commit
0c3985c0
authored
Apr 21, 2017
by
François Grisez
Browse files
Generate the docstrings for the enums and enum values
parent
e4068bb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
wrappers/cpp/enums_header.mustache
View file @
0c3985c0
...
...
@@ -22,8 +22,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace linphone {
{{#
enums
}}
{{#
doc
}}
/**
{{#
lines
}}
*
{{{
line
}}}
{{/
lines
}}
*
*/
{{/
doc
}}
enum
{{
name
}}
{
{{#
values
}}
{{#
doc
}}
/**
{{#
lines
}}
*
{{{
line
}}}
{{/
lines
}}
*/
{{/
doc
}}
{{
name
}}{{#
value
}}
=
{{{
value
}}}{{/
value
}}{{#
notLast
}}
,
{{/
notLast
}}
{{/
values
}}
};
...
...
wrappers/cpp/genwrapper.py
View file @
0c3985c0
...
...
@@ -35,27 +35,28 @@ class CppTranslator(object):
def
__init__
(
self
):
self
.
ignore
=
[]
self
.
ambigousTypes
=
[
'LinphonePayloadType'
]
self
.
docTranslator
=
metadoc
.
DoxygenCppTranslator
()
def
is_ambigous_type
(
self
,
_type
):
return
_type
.
name
in
self
.
ambigousTypes
or
(
_type
.
name
==
'list'
and
self
.
is_ambigous_type
(
_type
.
containedTypeDesc
))
@
staticmethod
def
translate_enum
(
enum
):
def
translate_enum
(
self
,
enum
):
enumDict
=
{}
enumDict
[
'name'
]
=
enum
.
name
.
to_camel_case
()
enumDict
[
'doc'
]
=
self
.
docTranslator
.
translate
(
enum
.
briefDescription
)
enumDict
[
'values'
]
=
[]
i
=
0
for
enumValue
in
enum
.
values
:
enumValDict
=
CppTranslator
.
translate_enum_value
(
enumValue
)
enumValDict
=
self
.
translate_enum_value
(
enumValue
)
enumValDict
[
'notLast'
]
=
(
i
!=
len
(
enum
.
values
)
-
1
)
enumDict
[
'values'
].
append
(
enumValDict
)
i
+=
1
return
enumDict
@
staticmethod
def
translate_enum_value
(
enumValue
):
def
translate_enum_value
(
self
,
enumValue
):
enumValueDict
=
{}
enumValueDict
[
'name'
]
=
CppTranslator
.
translate_enum_value_name
(
enumValue
.
name
)
enumValueDict
[
'doc'
]
=
self
.
docTranslator
.
translate
(
enumValue
.
briefDescription
)
if
type
(
enumValue
.
value
)
is
int
:
enumValueDict
[
'value'
]
=
str
(
enumValue
.
value
)
elif
type
(
enumValue
.
value
)
is
AbsApi
.
Flag
:
...
...
@@ -241,8 +242,7 @@ class CppTranslator(object):
methodDict
[
'implPrototype'
]
=
'{implReturn} {longname}({implParams}){const}'
.
format
(
**
methodElems
)
methodDict
[
'sourceCode'
]
=
self
.
_generate_source_code
(
method
,
usedNamespace
=
namespace
)
t
=
metadoc
.
DoxygenCppTranslator
()
methodDict
[
'doc'
]
=
t
.
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
return
methodDict
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment