X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.hpp;h=e08832f608d6247e9febce369f32c3b8aea843e5;hp=3efaf795b2ea985c57d69b91e40f3421c107bdfb;hb=1325ce422f1b49ab1f693125105b8c373c2965e5;hpb=efdec55aec1a137460fa362a381ed1904182bfed;ds=sidebyside diff --git a/pv/devices/inputfile.hpp b/pv/devices/inputfile.hpp index 3efaf795..e08832f6 100644 --- a/pv/devices/inputfile.hpp +++ b/pv/devices/inputfile.hpp @@ -26,19 +26,37 @@ #include "file.hpp" +#include + +using std::atomic; +using std::ifstream; +using std::map; +using std::shared_ptr; +using std::streamsize; +using std::string; + namespace pv { namespace devices { class InputFile final : public File { private: - static const std::streamsize BufferSize; + static const streamsize BufferSize; public: - InputFile(const std::shared_ptr &context, - const std::string &file_name, - std::shared_ptr format, - const std::map &options); + InputFile(const shared_ptr &context, + const string &file_name, + shared_ptr format, + const map &options); + + /** + * Constructor that loads a file using the metadata saved by + * save_meta_to_settings() before. + */ + InputFile(const shared_ptr &context, + QSettings &settings); + + void save_meta_to_settings(QSettings &settings); void open(); @@ -51,13 +69,13 @@ public: void stop(); private: - const std::shared_ptr context_; - const std::shared_ptr format_; - const std::map options_; - std::shared_ptr input_; + const shared_ptr context_; + shared_ptr format_; + map options_; + shared_ptr input_; - std::ifstream *f; - std::atomic interrupt_; + ifstream *f; + atomic interrupt_; }; } // namespace devices