X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fspl.cc;h=7692df0cab1680d9800423c629eed32003e6e5db;hb=2f796cd531de522a3b7ed03a9942f3c55f3a0b5b;hp=cd33c4047815386ec7ef524872e2fd06619e198e;hpb=ed227b4fdba9b4fc7f06f6db4830219f14bad358;p=dcpomatic.git diff --git a/src/lib/spl.cc b/src/lib/spl.cc index cd33c4047..7692df0ca 100644 --- a/src/lib/spl.cc +++ b/src/lib/spl.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -18,15 +18,21 @@ */ -#include "spl.h" #include "content_store.h" +#include "spl.h" +#include "warnings.h" #include +#include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include using std::cout; +using std::string; using boost::shared_ptr; +using dcp::raw_convert; void SPL::read (boost::filesystem::path path, ContentStore* store) @@ -36,16 +42,15 @@ SPL::read (boost::filesystem::path path, ContentStore* store) cxml::Document doc ("SPL"); doc.read_file (path); _id = doc.string_child("Id"); + _name = doc.string_child("Name"); BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("Entry")) { shared_ptr c = store->get(i->string_child("Digest")); if (c) { - add (SPLEntry(c, i)); + add (SPLEntry(c)); } else { _missing = true; } } - - _name = path.filename().string(); } void @@ -54,6 +59,7 @@ SPL::write (boost::filesystem::path path) const xmlpp::Document doc; xmlpp::Element* root = doc.create_root_node ("SPL"); root->add_child("Id")->add_child_text (_id); + root->add_child("Name")->add_child_text (_name); BOOST_FOREACH (SPLEntry i, _spl) { i.as_xml (root->add_child("Entry")); }