X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Finputfile.cpp;h=58c60d700bbd25375222b20f09c7f35a41097e3a;hp=7c981f1acd926bfd13054e186292b60d36d3a971;hb=6f925ba9d6faf1077b73c5a5808259576081716a;hpb=00f6bae935837b38b0d03a5928ba8175d460413f diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 7c981f1..58c60d7 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -24,15 +24,22 @@ #include "inputfile.hpp" +using std::map; +using std::shared_ptr; +using std::streamsize; +using std::string; +using std::ifstream; +using std::ios; + namespace pv { namespace devices { -const std::streamsize InputFile::BufferSize = 16384; +const streamsize InputFile::BufferSize = 16384; -InputFile::InputFile(const std::shared_ptr &context, - const std::string &file_name, - std::shared_ptr format, - const std::map &options) : +InputFile::InputFile(const shared_ptr &context, + const string &file_name, + shared_ptr format, + const map &options) : File(file_name), context_(context), format_(format), @@ -55,11 +62,11 @@ void InputFile::open() // open() should add the input device to the session but // we can't open the device without sending some data first - f = new std::ifstream(file_name_, std::ios::binary); + f = new ifstream(file_name_, ios::binary); char buffer[BufferSize]; f->read(buffer, BufferSize); - const std::streamsize size = f->gcount(); + const streamsize size = f->gcount(); if (size == 0) return; @@ -90,14 +97,14 @@ void InputFile::run() if (!f) { // Previous call to run() processed the entire file already - f = new std::ifstream(file_name_, std::ios::binary); + f = new ifstream(file_name_, ios::binary); input_->reset(); } interrupt_ = false; while (!interrupt_ && !f->eof()) { f->read(buffer, BufferSize); - const std::streamsize size = f->gcount(); + const streamsize size = f->gcount(); if (size == 0) break;