]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Expose ConfigKey::identifier as an attribute.
authorMartin Ling <redacted>
Tue, 11 Nov 2014 01:24:19 +0000 (01:24 +0000)
committerUwe Hermann <redacted>
Wed, 12 Nov 2014 01:27:04 +0000 (02:27 +0100)
bindings/cxx/ConfigKey_methods.i [new file with mode: 0644]
bindings/cxx/enums.py

diff --git a/bindings/cxx/ConfigKey_methods.i b/bindings/cxx/ConfigKey_methods.i
new file mode 100644 (file)
index 0000000..eaa2ab6
--- /dev/null
@@ -0,0 +1 @@
+%attributestring(sigrok::ConfigKey, std::string, identifier, identifier);
index d0b4ec44ca2b25ce3568fe5fc6a20e104de61810..25bd6f428271a939cd7fa6a8bba2c5c5f44e7e6c 100644 (file)
@@ -154,3 +154,7 @@ for enum, (classname, classbrief) in classes.items():
     print >> swig, '%%template(EnumValue%s) sigrok::EnumValue<sigrok::%s, enum %s>;' % (
         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())