projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make ::swap virtual.
[libdcp.git]
/
src
/
asset.cc
diff --git
a/src/asset.cc
b/src/asset.cc
index 96196b41e3a999a284ca9db7803bd93471c5ce32..7e60ecc5300dfc80af79c8a524c5193a887b650e 100644
(file)
--- a/
src/asset.cc
+++ b/
src/asset.cc
@@
-25,6
+25,7
@@
#include "asset.h"
#include "util.h"
#include "exceptions.h"
#include "asset.h"
#include "util.h"
#include "exceptions.h"
+#include "dcp_assert.h"
#include "compose.hpp"
#include <libxml++/libxml++.h>
#include "compose.hpp"
#include <libxml++/libxml++.h>
@@
-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
{
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);
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
{
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);
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<void (float)> progress) const
{
string
Asset::hash (function<void (float)> progress) const
{
-
assert
(!_file.empty ());
+
DCP_ASSERT
(!_file.empty ());
if (_hash.empty ()) {
_hash = make_digest (_file, progress);
if (_hash.empty ()) {
_hash = make_digest (_file, progress);
@@
-102,7
+94,7
@@
Asset::hash (function<void (float)> progress) const
}
bool
}
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");
{
if (_hash != other->_hash) {
note (DCP_ERROR, "Asset: hashes differ");