diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-07-29 15:53:26 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-29 15:53:26 +0100 |
| commit | 8ef91325f4e565d04493bc05202f8e066b5e3e0c (patch) | |
| tree | 162fbc2bef7243ff1f650cd7e91c851e783ba8c6 /src/dcp.cc | |
| parent | e02bf26f284c6efc72593e6b4a251301144e5d0b (diff) | |
Basics of allowing custom filenames for DCP components.
Diffstat (limited to 'src/dcp.cc')
| -rw-r--r-- | src/dcp.cc | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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); |
