42 #include "filesystem.h"
52 ArrayData::ArrayData ()
53 : _data(std::make_shared<std::vector<uint8_t>>())
59 ArrayData::ArrayData (
int size)
60 : _data(std::make_shared<std::vector<uint8_t>>(size))
66 ArrayData::ArrayData (uint8_t
const * data,
int size)
67 : _data(std::make_shared<std::vector<uint8_t>>(data, data + size))
73 ArrayData::ArrayData (boost::filesystem::path file)
75 auto const size = filesystem::file_size(file);
76 _data = std::make_shared<std::vector<uint8_t>>(
size);
80 throw FileError (
"could not open file for reading", file, errno);
83 if (f.read(_data->data(), 1,
size) !=
static_cast<size_t>(
size)) {
84 throw FileError (
"could not read from file", file, errno);
int size() const override
An exception related to a file.
Exceptions thrown by libdcp.
Namespace for everything in libdcp.
Utility methods and classes.