Tidying.
[libdcp.git] / src / pkl.cc
index 2a5b8b7dc68a66c162e989bf96a40f5c46e780f7..4971178ec1ed6f0b60e3dce892ad23f4a2219d58 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     files in the program, then also delete it here.
 */
 
+
 #include "pkl.h"
 #include "exceptions.h"
 #include "util.h"
 #include "raw_convert.h"
 #include "dcp_assert.h"
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
+
 using std::string;
 using std::shared_ptr;
 using std::make_shared;
 using boost::optional;
 using namespace dcp;
 
+
 static string const pkl_interop_ns = "http://www.digicine.com/PROTO-ASDCP-PKL-20040311#";
 static string const pkl_smpte_ns   = "http://www.smpte-ra.org/schemas/429-8/2007/PKL";
 
+
 PKL::PKL (boost::filesystem::path file)
        : _file (file)
 {
@@ -56,9 +59,9 @@ PKL::PKL (boost::filesystem::path file)
        pkl.read_file (file);
 
        if (pkl.namespace_uri() == pkl_interop_ns) {
-               _standard = INTEROP;
+               _standard = Standard::INTEROP;
        } else if (pkl.namespace_uri() == pkl_smpte_ns) {
-               _standard = SMPTE;
+               _standard = Standard::SMPTE;
        } else {
                boost::throw_exception (XMLError ("Unrecognised packing list namesapce " + pkl.namespace_uri()));
        }
@@ -74,18 +77,20 @@ PKL::PKL (boost::filesystem::path file)
        }
 }
 
+
 void
 PKL::add_asset (std::string id, boost::optional<std::string> annotation_text, std::string hash, int64_t size, std::string type)
 {
        _asset_list.push_back (make_shared<Asset>(id, annotation_text, hash, size, type));
 }
 
+
 void
 PKL::write (boost::filesystem::path file, shared_ptr<const CertificateChain> signer) const
 {
        xmlpp::Document doc;
        xmlpp::Element* pkl;
-       if (_standard == INTEROP) {
+       if (_standard == Standard::INTEROP) {
                pkl = doc.create_root_node("PackingList", pkl_interop_ns);
        } else {
                pkl = doc.create_root_node("PackingList", pkl_smpte_ns);
@@ -121,6 +126,7 @@ PKL::write (boost::filesystem::path file, shared_ptr<const CertificateChain> sig
        _file = file;
 }
 
+
 optional<string>
 PKL::hash (string id) const
 {
@@ -133,6 +139,7 @@ PKL::hash (string id) const
        return {};
 }
 
+
 optional<string>
 PKL::type (string id) const
 {