]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Add Session::filename() and corresponding SWIG attribute.
authorMartin Ling <redacted>
Sun, 12 Oct 2014 16:53:10 +0000 (17:53 +0100)
committerBert Vermeulen <redacted>
Wed, 15 Oct 2014 11:44:44 +0000 (13:44 +0200)
bindings/cxx/classes.cpp
bindings/cxx/include/libsigrok/libsigrok.hpp
bindings/swig/classes.i

index 9bce464c9de979099c6b1faf2a0ab72baba70dcd..1747bdff5f0c787545a80afa3f20b4efdfacbaa4 100644 (file)
@@ -1071,6 +1071,11 @@ void Session::set_trigger(shared_ptr<Trigger> trigger)
        _trigger = trigger;
 }
 
+string Session::filename()
+{
+       return _filename;
+}
+
 Packet::Packet(shared_ptr<Device> device,
        const struct sr_datafeed_packet *structure) :
        UserOwned(structure),
index 1936d4d5d2820c3de60e395d199e64442890199f..3e49bd5986defbc4cbabc789c0adf0be2c08a9f6 100644 (file)
@@ -672,6 +672,8 @@ public:
        /** Set trigger setting.
         * @param trigger Trigger object to use. */
        void set_trigger(shared_ptr<Trigger> trigger);
+       /** Get filename this session was loaded from. */
+       string filename();
 protected:
        Session(shared_ptr<Context> context);
        Session(shared_ptr<Context> context, string filename);
index f4ee3ec4ab4f1a6029bee3ca65af6ee15b820625..b688a857494fdb0a4b273b60b6db0720188eadc6 100644 (file)
@@ -257,6 +257,8 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
 %attributestring(sigrok::Session,
     std::shared_ptr<sigrok::Trigger>, trigger, trigger, set_trigger);
 
+%attributestring(sigrok::Session, std::string, filename, filename);
+
 %attribute(sigrok::Packet,
     const sigrok::PacketType *, type, type);
 %attributestring(sigrok::Packet,