X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fcxx%2Fclasses.cpp;h=6c3b15f159018d90e14d57f97fc6f7ca34f51cb1;hb=3f03ffaf2f7c9c65d0bf35e611df8fb720ed0e8c;hp=a08def8eebaed63d6482ffc17c5d6970da3bf2c5;hpb=2b51d48b386a2050d0ab34f242161617877d8e5f;p=libsigrok.git diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index a08def8e..6c3b15f1 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include "libsigrokcxx/libsigrokcxx.hpp" +#include #include #include @@ -1565,10 +1565,33 @@ shared_ptr OutputFormat::create_output( Output::Deleter()); } +shared_ptr OutputFormat::create_output(string filename, + shared_ptr device, map options) +{ + return shared_ptr( + new Output(filename, shared_from_this(), device, options), + Output::Deleter()); +} + +bool OutputFormat::test_flag(const OutputFlag *flag) +{ + return sr_output_test_flag(_structure, flag->id()); +} + Output::Output(shared_ptr format, shared_ptr device, map 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 format, + shared_ptr device, map options) : + UserOwned(sr_output_new(format->_structure, + map_to_hash_variant(options), device->_structure, filename.c_str())), _format(format), _device(device), _options(options) @@ -1596,6 +1619,6 @@ string Output::receive(shared_ptr packet) } } -#include "enums.cpp" +#include }