#include "asset.h"
#include "util.h"
#include "exceptions.h"
+#include "dcp_assert.h"
#include "compose.hpp"
#include <libxml++/libxml++.h>
}
-/** 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);
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);
string
Asset::hash (function<void (float)> progress) const
{
- assert (!_file.empty ());
+ DCP_ASSERT (!_file.empty ());
if (_hash.empty ()) {
_hash = make_digest (_file, progress);
}
bool
-Asset::equals (boost::shared_ptr<const Asset> other, EqualityOptions, function<void (NoteType, string)> note) const
+Asset::equals (boost::shared_ptr<const Asset> other, EqualityOptions, NoteHandler note) const
{
if (_hash != other->_hash) {
- note (DCP_ERROR, "Asset hashes differ");
+ note (DCP_ERROR, "Asset: hashes differ");
return false;
}