summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-07-29 15:53:26 +0100
committerCarl Hetherington <cth@carlh.net>2016-07-29 15:53:26 +0100
commit8ef91325f4e565d04493bc05202f8e066b5e3e0c (patch)
tree162fbc2bef7243ff1f650cd7e91c851e783ba8c6 /src/dcp.cc
parente02bf26f284c6efc72593e6b4a251301144e5d0b (diff)
Basics of allowing custom filenames for DCP components.
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index d2fc9745..18b06c55 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -303,10 +303,10 @@ DCP::add (DecryptedKDM const & kdm)
}
boost::filesystem::path
-DCP::write_pkl (Standard standard, string pkl_uuid, XMLMetadata metadata, shared_ptr<const CertificateChain> signer) const
+DCP::write_pkl (string file, Standard standard, string pkl_uuid, XMLMetadata metadata, shared_ptr<const CertificateChain> signer) const
{
boost::filesystem::path p = _directory;
- p /= String::compose ("pkl_%1.xml", pkl_uuid);
+ p /= file;
xmlpp::Document doc;
xmlpp::Element* pkl;
@@ -458,16 +458,22 @@ void
DCP::write_xml (
Standard standard,
XMLMetadata metadata,
- shared_ptr<const CertificateChain> signer
+ shared_ptr<const CertificateChain> signer,
+ FilenameFormat filename_format
)
{
BOOST_FOREACH (shared_ptr<CPL> i, cpls ()) {
- string const filename = "cpl_" + i->id() + ".xml";
- i->write_xml (_directory / filename, standard, signer);
+ NameFormat::Map values;
+ values["type"] = "cpl";
+ values["id"] = i->id();
+ i->write_xml (_directory / (filename_format.get(values) + ".xml"), standard, signer);
}
string const pkl_uuid = make_uuid ();
- boost::filesystem::path const pkl_path = write_pkl (standard, pkl_uuid, metadata, signer);
+ NameFormat::Map values;
+ values["type"] = "pkl";
+ values["id"] = pkl_uuid;
+ boost::filesystem::path const pkl_path = write_pkl (filename_format.get(values) + ".xml", standard, pkl_uuid, metadata, signer);
write_volindex (standard);
write_assetmap (standard, pkl_uuid, boost::filesystem::file_size (pkl_path), metadata);