X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdata.cc;h=eb3ec4c634c1fc2104fe4a1f6301550369c56cc2;hb=1ad291db7e847fbb71e5bd9f2f81db6bfb2a022e;hp=e117199a1c9b3cfcbc736248edf36f274eececf1;hpb=5c0a67869dbddb924c9f5ccb4126aa06d85b9b8b;p=dcpomatic.git diff --git a/src/lib/data.cc b/src/lib/data.cc index e117199a1..eb3ec4c63 100644 --- a/src/lib/data.cc +++ b/src/lib/data.cc @@ -20,11 +20,18 @@ #include "data.h" #include "cross.h" #include "exceptions.h" +#include #include "i18n.h" using boost::shared_array; +Data::Data () + : _size (0) +{ + +} + Data::Data (int size) : _data (new uint8_t[size]) , _size (size) @@ -48,13 +55,13 @@ Data::Data (boost::filesystem::path file) if (!f) { throw FileError (_("could not open file for reading"), file); } - + size_t const r = fread (_data.get(), 1, _size, f); if (r != size_t (_size)) { fclose (f); throw FileError (_("could not read from file"), file); } - + fclose (f); }