summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-16 16:24:07 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-16 16:24:07 +0100
commit81ed0ebb725a7b5fec00ae209ba8b0d70ebc4ee1 (patch)
tree41609bbfaf9364b615d6d2178ebea9f3da4451a2
parentf98f4f58e0b76cf60747897cbb8e488d8e29597a (diff)
Always use ID in custom filenames.
-rw-r--r--src/dcp.cc6
-rw-r--r--src/dcp.h2
-rw-r--r--src/name_format.cc4
-rw-r--r--src/name_format.h2
4 files changed, 6 insertions, 8 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 8aff6c40..fb0f2625 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -466,15 +466,13 @@ DCP::write_xml (
BOOST_FOREACH (shared_ptr<CPL> i, cpls ()) {
NameFormat::Map values;
values['t'] = "cpl";
- values['i'] = i->id();
- i->write_xml (_directory / (name_format.get(values) + ".xml"), standard, signer);
+ i->write_xml (_directory / (name_format.get(values, "_" + i->id() + ".xml")), standard, signer);
}
string const pkl_uuid = make_uuid ();
NameFormat::Map values;
values['t'] = "pkl";
- values['i'] = pkl_uuid;
- boost::filesystem::path const pkl_path = write_pkl (name_format.get(values) + ".xml", standard, pkl_uuid, metadata, signer);
+ boost::filesystem::path const pkl_path = write_pkl (name_format.get(values, "_" + pkl_uuid + ".xml"), standard, pkl_uuid, metadata, signer);
write_volindex (standard);
write_assetmap (standard, pkl_uuid, pkl_path, metadata);
diff --git a/src/dcp.h b/src/dcp.h
index 2f297d82..e2919a38 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -113,7 +113,7 @@ public:
Standard standard,
XMLMetadata metadata = XMLMetadata (),
boost::shared_ptr<const CertificateChain> signer = boost::shared_ptr<const CertificateChain> (),
- NameFormat name_format = NameFormat("%t_%i")
+ NameFormat name_format = NameFormat("%t")
);
void resolve_refs (std::list<boost::shared_ptr<Asset> > assets);
diff --git a/src/name_format.cc b/src/name_format.cc
index a85f232d..7b9cfd63 100644
--- a/src/name_format.cc
+++ b/src/name_format.cc
@@ -65,7 +65,7 @@ filter (string c)
}
string
-NameFormat::get (Map values) const
+NameFormat::get (Map values, string suffix) const
{
string result;
for (size_t i = 0; i < _specification.length(); ++i) {
@@ -84,7 +84,7 @@ NameFormat::get (Map values) const
}
}
- return result;
+ return result + suffix;
}
bool
diff --git a/src/name_format.h b/src/name_format.h
index 7390dd5c..eb6f4308 100644
--- a/src/name_format.h
+++ b/src/name_format.h
@@ -59,7 +59,7 @@ public:
typedef std::map<char, std::string> Map;
- std::string get (Map) const;
+ std::string get (Map, std::string suffix) const;
private:
std::string _specification;