diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-04-20 23:41:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-08-17 00:46:19 +0100 |
| commit | 2f6087e528c1a48fed0ac7166b1ff8704684c87a (patch) | |
| tree | dcffc9da0bc8ec3341a7e8679284531836f7192f /src/asset.cc | |
| parent | b1a47060818175bf222da2ab11f7caec73f5a70c (diff) | |
Read PKL when reading DCP.
Diffstat (limited to 'src/asset.cc')
| -rw-r--r-- | src/asset.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/asset.cc b/src/asset.cc index 7d3a9813..24fdfe6c 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -41,11 +41,13 @@ #include "exceptions.h" #include "dcp_assert.h" #include "compose.hpp" +#include "pkl.h" #include <libxml++/libxml++.h> #include <boost/algorithm/string.hpp> using std::string; using boost::function; +using boost::shared_ptr; using boost::optional; using namespace dcp; @@ -76,7 +78,7 @@ Asset::Asset (string id, boost::filesystem::path file) } void -Asset::write_to_pkl (xmlpp::Node* node, boost::filesystem::path root, Standard standard) const +Asset::add_to_pkl (shared_ptr<PKL> pkl, boost::filesystem::path root) const { DCP_ASSERT (_file); @@ -92,12 +94,7 @@ Asset::write_to_pkl (xmlpp::Node* node, boost::filesystem::path root, Standard s return; } - xmlpp::Node* asset = node->add_child ("Asset"); - asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); - asset->add_child("AnnotationText")->add_child_text (_id); - asset->add_child("Hash")->add_child_text (hash ()); - asset->add_child("Size")->add_child_text (raw_convert<string> (boost::filesystem::file_size (_file.get()))); - asset->add_child("Type")->add_child_text (pkl_type (standard)); + pkl->add_asset (_id, _id, hash(), boost::filesystem::file_size (_file.get()), pkl_type (pkl->standard())); } void |
