47 using boost::shared_array;
51 ArrayData::ArrayData ()
57 ArrayData::ArrayData (
int size)
58 : _data (new uint8_t[size])
65 ArrayData::ArrayData (uint8_t
const * data,
int size)
66 : _data (new uint8_t[size])
69 memcpy (_data.get(), data, size);
73 ArrayData::ArrayData (shared_array<uint8_t> data,
int size)
81 ArrayData::ArrayData (boost::filesystem::path file)
83 _size = boost::filesystem::file_size (file);
84 _data.reset (
new uint8_t[
_size]);
88 throw FileError (
"could not open file for reading", file, errno);
91 auto const r = fread (_data.get(), 1,
_size, f);
93 if (r !=
static_cast<size_t>(
_size)) {
94 throw FileError (
"could not read from file", file, errno);
An exception related to a file.
Exceptions thrown by libdcp.
Namespace for everything in libdcp.
FILE * fopen_boost(boost::filesystem::path, std::string)
Utility methods and classes.