summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-01 00:47:53 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-01 00:47:53 +0100
commitd46f9684e7c4a77d07b4bb6f4b8c85dba2584597 (patch)
tree4ddeb09847f93600301422394936d544de9eba7d /src
parent11990d194b5071b7f57ead972369dd9598f04ca3 (diff)
Simplify NameFormat stuff.
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc6
-rw-r--r--src/dcp.h4
-rw-r--r--src/filename_format.cc52
-rw-r--r--src/filename_format.h50
-rw-r--r--src/name_format.cc6
-rw-r--r--src/name_format.h19
-rw-r--r--src/wscript2
7 files changed, 10 insertions, 129 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index ba72df8c..6af144dd 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -459,21 +459,21 @@ DCP::write_xml (
Standard standard,
XMLMetadata metadata,
shared_ptr<const CertificateChain> signer,
- FilenameFormat filename_format
+ NameFormat name_format
)
{
BOOST_FOREACH (shared_ptr<CPL> i, cpls ()) {
NameFormat::Map values;
values['t'] = "cpl";
values['i'] = i->id();
- i->write_xml (_directory / (filename_format.get(values) + ".xml"), standard, signer);
+ i->write_xml (_directory / (name_format.get(values) + ".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 (filename_format.get(values) + ".xml", standard, pkl_uuid, metadata, signer);
+ boost::filesystem::path const pkl_path = write_pkl (name_format.get(values) + ".xml", standard, pkl_uuid, metadata, signer);
write_volindex (standard);
write_assetmap (standard, pkl_uuid, boost::filesystem::file_size (pkl_path), metadata);
diff --git a/src/dcp.h b/src/dcp.h
index cc87d0d1..fecf3cff 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -41,7 +41,7 @@
#include "types.h"
#include "certificate.h"
#include "metadata.h"
-#include "filename_format.h"
+#include "name_format.h"
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
#include <string>
@@ -113,7 +113,7 @@ public:
Standard standard,
XMLMetadata metadata = XMLMetadata (),
boost::shared_ptr<const CertificateChain> signer = boost::shared_ptr<const CertificateChain> (),
- FilenameFormat filename_format = FilenameFormat("%t_%i")
+ NameFormat name_format = NameFormat("%t_%i")
);
void resolve_refs (std::list<boost::shared_ptr<Asset> > assets);
diff --git a/src/filename_format.cc b/src/filename_format.cc
deleted file mode 100644
index a3165612..00000000
--- a/src/filename_format.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of libdcp.
-
- libdcp is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- libdcp is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with libdcp. If not, see <http://www.gnu.org/licenses/>.
-
- In addition, as a special exception, the copyright holders give
- permission to link the code of portions of this program with the
- OpenSSL library under certain conditions as described in each
- individual source file, and distribute linked combinations
- including the two.
-
- You must obey the GNU General Public License in all respects
- for all of the code used other than OpenSSL. If you modify
- file(s) with this exception, you may extend this exception to your
- version of the file(s), but you are not obligated to do so. If you
- do not wish to do so, delete this exception statement from your
- version. If you delete this exception statement from all source
- files in the program, then also delete it here.
-*/
-
-#include "filename_format.h"
-
-using std::string;
-using namespace dcp;
-
-FilenameFormat::FilenameFormat (string specification)
- : NameFormat (specification)
-{
- /* asset type */
- add ('t');
- /* unique ID */
- add ('i');
- /* reel index */
- add ('r');
- /* reel count */
- add ('n');
- /* content name */
- add ('c');
-}
diff --git a/src/filename_format.h b/src/filename_format.h
deleted file mode 100644
index 836c643a..00000000
--- a/src/filename_format.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of libdcp.
-
- libdcp is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- libdcp is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with libdcp. If not, see <http://www.gnu.org/licenses/>.
-
- In addition, as a special exception, the copyright holders give
- permission to link the code of portions of this program with the
- OpenSSL library under certain conditions as described in each
- individual source file, and distribute linked combinations
- including the two.
-
- You must obey the GNU General Public License in all respects
- for all of the code used other than OpenSSL. If you modify
- file(s) with this exception, you may extend this exception to your
- version of the file(s), but you are not obligated to do so. If you
- do not wish to do so, delete this exception statement from your
- version. If you delete this exception statement from all source
- files in the program, then also delete it here.
-*/
-
-#ifndef LIBDCP_FILENAME_FORMAT
-#define LIBDCP_FILENAME_FORMAT
-
-#include "name_format.h"
-
-namespace dcp {
-
-class FilenameFormat : public NameFormat
-{
-public:
- FilenameFormat () {}
- FilenameFormat (std::string specification);
-};
-
-}
-
-#endif
diff --git a/src/name_format.cc b/src/name_format.cc
index 300ff315..a85f232d 100644
--- a/src/name_format.cc
+++ b/src/name_format.cc
@@ -64,12 +64,6 @@ filter (string c)
return o;
}
-void
-NameFormat::add (char placeholder)
-{
- _components.push_back (placeholder);
-}
-
string
NameFormat::get (Map values) const
{
diff --git a/src/name_format.h b/src/name_format.h
index 7eb2713f..7390dd5c 100644
--- a/src/name_format.h
+++ b/src/name_format.h
@@ -43,9 +43,11 @@ namespace dcp {
class NameFormat
{
public:
- std::list<char> components () const {
- return _components;
- }
+ NameFormat () {}
+
+ NameFormat (std::string specification)
+ : _specification (specification)
+ {}
std::string specification () const {
return _specification;
@@ -59,18 +61,7 @@ public:
std::string get (Map) const;
-protected:
- NameFormat () {}
-
- NameFormat (std::string specification)
- : _specification (specification)
- {}
-
- void add (char placeholder);
-
private:
- /** placeholders for each component */
- std::list<char> _components;
std::string _specification;
};
diff --git a/src/wscript b/src/wscript
index 43fc0e69..9430aeca 100644
--- a/src/wscript
+++ b/src/wscript
@@ -51,7 +51,6 @@ def build(bld):
encrypted_kdm.cc
exceptions.cc
file.cc
- filename_format.cc
font_asset.cc
font_node.cc
gamma_transfer_function.cc
@@ -121,7 +120,6 @@ def build(bld):
decrypted_kdm_key.h
encrypted_kdm.h
exceptions.h
- filename_format.h
font_asset.h
gamma_transfer_function.h
interop_load_font_node.h