From 9e613ae8a3cd7994194d2d709f6ff9b88feac70b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 31 Oct 2020 22:44:28 +0100 Subject: Add Data class and change API to a raw pointer. --- src/array_data.cc | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/array_data.cc') diff --git a/src/array_data.cc b/src/array_data.cc index 9d8473b8..a6f73868 100644 --- a/src/array_data.cc +++ b/src/array_data.cc @@ -85,31 +85,3 @@ ArrayData::ArrayData (boost::filesystem::path file) fclose (f); } - -void -ArrayData::write (boost::filesystem::path file) const -{ - FILE* f = fopen_boost (file, "wb"); - if (!f) { - throw FileError ("could not write to file", file, errno); - } - size_t const r = fwrite (_data.get(), 1, _size, f); - if (r != size_t (_size)) { - fclose (f); - throw FileError ("could not write to file", file, errno); - } - fclose (f); -} - -void -ArrayData::write_via_temp (boost::filesystem::path temp, boost::filesystem::path final) const -{ - write (temp); - boost::filesystem::rename (temp, final); -} - -bool -dcp::operator== (ArrayData const & a, ArrayData const & b) -{ - return (a.size() == b.size() && memcmp (a.data().get(), b.data().get(), a.size()) == 0); -} -- cgit v1.2.3