mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
added handling of constants equaling constants for C++ map
This commit is contained in:
parent
6b88a21be8
commit
136f205fb3
@ -33,7 +33,6 @@ class MatlabWrapperGenerator(object):
|
||||
jtemplate.filters['void'] = void
|
||||
jtemplate.filters['not'] = flip
|
||||
|
||||
|
||||
# load the templates
|
||||
tfunction = jtemplate.get_template('template_function_base.cpp')
|
||||
tclassm = jtemplate.get_template('template_class_base.m')
|
||||
|
@ -22,6 +22,10 @@ typedef std::unordered_map Map;
|
||||
*/
|
||||
Map<std::string, int> constants = {
|
||||
{% for key, val in constants.items() %}
|
||||
{% if val|convertibleToInt %}
|
||||
{ "{{key}}", {{val}} },
|
||||
{% else %}
|
||||
{ "{{key}}", {{constants[val]}} },
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user