51 Data::write (boost::filesystem::path file)
const
55 throw FileError (
"could not write to file", file, errno);
57 size_t const r = fwrite (data(), 1, size(), f);
59 if (r !=
size_t(size())) {
60 throw FileError (
"could not write to file", file, errno);
66 Data::write_via_temp (boost::filesystem::path temp, boost::filesystem::path
final)
const
69 boost::filesystem::rename (temp,
final);
74 dcp::operator== (
Data const & a,
Data const & b)
76 return (a.size() == b.size() && memcmp(a.data(), b.data(), a.size()) == 0);
81 dcp::operator!= (
Data const & a,
Data const & b)
83 return (a.size() != b.size() || memcmp(a.data(), b.data(), a.size()) != 0);
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.