]> sigrok.org Git - libsigrok.git/blobdiff - bindings/cxx/classes.cpp
Add filename field to sr_output and make it accessible
[libsigrok.git] / bindings / cxx / classes.cpp
index a08def8eebaed63d6482ffc17c5d6970da3bf2c5..357c9d6f3cbccac46f24a7d1c74025c525b40324 100644 (file)
@@ -1565,10 +1565,28 @@ shared_ptr<Output> OutputFormat::create_output(
                Output::Deleter());
 }
 
+shared_ptr<Output> OutputFormat::create_output(string filename,
+       shared_ptr<Device> device, map<string, Glib::VariantBase> options)
+{
+       return shared_ptr<Output>(
+               new Output(filename, shared_from_this(), device, options),
+               Output::Deleter());
+}
+
 Output::Output(shared_ptr<OutputFormat> format,
                shared_ptr<Device> device, map<string, Glib::VariantBase> options) :
        UserOwned(sr_output_new(format->_structure,
-               map_to_hash_variant(options), device->_structure)),
+               map_to_hash_variant(options), device->_structure, NULL)),
+       _format(format),
+       _device(device),
+       _options(options)
+{
+}
+
+Output::Output(string filename, shared_ptr<OutputFormat> format,
+               shared_ptr<Device> device, map<string, Glib::VariantBase> options) :
+       UserOwned(sr_output_new(format->_structure,
+               map_to_hash_variant(options), device->_structure, filename.c_str())),
        _format(format),
        _device(device),
        _options(options)