From: Martin Ling Date: Tue, 11 Nov 2014 01:24:19 +0000 (+0000) Subject: bindings: Expose ConfigKey::identifier as an attribute. X-Git-Tag: libsigrok-0.4.0~797 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e480df0c4593d80df617b1a3da0065c0fb91a5ac;p=libsigrok.git bindings: Expose ConfigKey::identifier as an attribute. --- diff --git a/bindings/cxx/ConfigKey_methods.i b/bindings/cxx/ConfigKey_methods.i new file mode 100644 index 00000000..eaa2ab6d --- /dev/null +++ b/bindings/cxx/ConfigKey_methods.i @@ -0,0 +1 @@ +%attributestring(sigrok::ConfigKey, std::string, identifier, identifier); diff --git a/bindings/cxx/enums.py b/bindings/cxx/enums.py index d0b4ec44..25bd6f42 100644 --- a/bindings/cxx/enums.py +++ b/bindings/cxx/enums.py @@ -154,3 +154,7 @@ for enum, (classname, classbrief) in classes.items(): print >> swig, '%%template(EnumValue%s) sigrok::EnumValue;' % ( classname, classname, enum_name) + # Declare additional attributes if present + filename = os.path.join(dirname, "%s_methods.i" % classname) + if os.path.exists(filename): + print >> swig, str.join('', open(filename).readlines())