X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fcxx%2Fenums.py;h=e942058cc3fb11e7b3748cd301d398d042e1cf98;hb=90486ba835ff82c316d63b3d3b69581615d9245a;hp=380faf91d838dc68195fe623d73722e7b38b10d2;hpb=33c84e81975c75b73002b038a0076f384ca13d63;p=libsigrok.git diff --git a/bindings/cxx/enums.py b/bindings/cxx/enums.py index 380faf91..e942058c 100644 --- a/bindings/cxx/enums.py +++ b/bindings/cxx/enums.py @@ -82,7 +82,7 @@ public: # Template for beginning of private members. header_private_template = """ private: - static const std::map values; + static const std::map _values; {classname}(enum {enumname} id, const char name[]); """ @@ -95,7 +95,7 @@ code_template = """ const {classname} *{classname}::get(int id) {{ - return {classname}::values.at(static_cast<{enumname}>(id)); + return {classname}::_values.at(static_cast<{enumname}>(id)); }} """ @@ -153,7 +153,7 @@ for enum, (classname, classbrief) in classes.items(): classname, classname, trimmed_name, classname, trimmed_name) # Define map of enum values to constants - print >> code, 'const std::map %s::values = {' % ( + print >> code, 'const std::map %s::_values = {' % ( enum_name, classname, classname) for name, trimmed_name in zip(member_names, trimmed_names): print >> code, '\t{%s, %s::%s},' % (name, classname, trimmed_name)