X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fasset.cc;h=7e60ecc5300dfc80af79c8a524c5193a887b650e;hb=1dc082f3295f64a9fd4a103078a1dbb5121a865d;hp=e55dca2dab05999c58d9c65d93efe330f9c1acf0;hpb=90d06f82e6baefc4b9b44631755d61f36884b677;p=libdcp.git diff --git a/src/asset.cc b/src/asset.cc index e55dca2d..7e60ecc5 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -25,6 +25,7 @@ #include "asset.h" #include "util.h" #include "exceptions.h" +#include "dcp_assert.h" #include "compose.hpp" #include @@ -48,19 +49,10 @@ Asset::Asset (boost::filesystem::path file) } -/** Create an Asset with a specified ID. - * @param id ID to use. - */ -Asset::Asset (string id) - : Object (id) -{ - -} - void Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const { - assert (!_file.empty ()); + DCP_ASSERT (!_file.empty ()); xmlpp::Node* asset = node->add_child ("Asset"); asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); @@ -73,7 +65,7 @@ Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const void Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const { - assert (!_file.empty ()); + DCP_ASSERT (!_file.empty ()); xmlpp::Node* asset = node->add_child ("Asset"); asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); @@ -92,7 +84,7 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const string Asset::hash (function progress) const { - assert (!_file.empty ()); + DCP_ASSERT (!_file.empty ()); if (_hash.empty ()) { _hash = make_digest (_file, progress); @@ -102,10 +94,10 @@ Asset::hash (function progress) const } bool -Asset::equals (boost::shared_ptr other, EqualityOptions, function note) const +Asset::equals (boost::shared_ptr other, EqualityOptions, NoteHandler note) const { if (_hash != other->_hash) { - note (DCP_ERROR, "Asset hashes differ"); + note (DCP_ERROR, "Asset: hashes differ"); return false; }