summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-02-12 23:25:57 +0000
committerCarl Hetherington <cth@carlh.net>2014-02-12 23:25:57 +0000
commite8c4fd0e0581849fcf41d918e79b00b84fe24d70 (patch)
tree0e087c053238118dc89ff49a0fb6dff838a6ad8a /src/asset.cc
parent6161444eab9e0c22c4a42a1b254745b8bee82b50 (diff)
Various small fixes.
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 738fb019..f8de10b6 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -31,6 +31,7 @@
using std::string;
using boost::lexical_cast;
using boost::function;
+using boost::optional;
using namespace dcp;
/** Create an Asset with a randomly-generated ID */
@@ -80,7 +81,7 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
xmlpp::Node* chunk_list = asset->add_child ("ChunkList");
xmlpp::Node* chunk = chunk_list->add_child ("Chunk");
- boost::optional<boost::filesystem::path> path = relative_to_root (root, _file);
+ optional<boost::filesystem::path> path = relative_to_root (root, _file);
if (!path) {
throw MiscError (String::compose ("Asset %1 is not within the directory %2", _file, root));
}
@@ -91,12 +92,12 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
}
string
-Asset::hash () const
+Asset::hash (function<void (float)> progress) const
{
assert (!_file.empty ());
if (_hash.empty ()) {
- _hash = make_digest (_file, 0);
+ _hash = make_digest (_file, progress);
}
return _hash;