summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/util_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python/modtool/util_functions.py')
-rw-r--r--gr-utils/python/modtool/util_functions.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/gr-utils/python/modtool/util_functions.py b/gr-utils/python/modtool/util_functions.py
index ea7af0cf7c..47799ac461 100644
--- a/gr-utils/python/modtool/util_functions.py
+++ b/gr-utils/python/modtool/util_functions.py
@@ -71,10 +71,17 @@ def strip_default_values(string):
return re.sub(' *=[^,)]*', '', string)
def strip_arg_types(string):
- """" Strip the argument types from a list of arguments
- Example: "int arg1, double arg2" -> "arg1, arg2" """
+ """"
+ Strip the argument types from a list of arguments.
+ Example: "int arg1, double arg2" -> "arg1, arg2"
+ Note that some types have qualifiers, which also are part of
+ the type, e.g. "const std::string &name" -> "name", or
+ "const char *str" -> "str".
+ """
string = strip_default_values(string)
- return ", ".join([part.strip().split(' ')[-1] for part in string.split(',')]).replace('&', '')
+ return ", ".join(
+ [part.strip().split(' ')[-1] for part in string.split(',')]
+ ).translate(None, '*&')
def strip_arg_types_grc(string):
"""" Strip the argument types from a list of arguments for GRC make tag.