projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put subtitle language back into content from the film (#1930).
[dcpomatic.git]
/
src
/
lib
/
spl.cc
diff --git
a/src/lib/spl.cc
b/src/lib/spl.cc
index cd33c4047815386ec7ef524872e2fd06619e198e..1677e626ff07ddf5cd25fb478aecdcd8da9075ed 100644
(file)
--- a/
src/lib/spl.cc
+++ b/
src/lib/spl.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,15
+18,20
@@
*/
*/
-#include "spl.h"
#include "content_store.h"
#include "content_store.h"
+#include "spl.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
#include <libcxml/cxml.h>
+#include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
+DCPOMATIC_ENABLE_WARNINGS
#include <iostream>
using std::cout;
#include <iostream>
using std::cout;
-using boost::shared_ptr;
+using std::string;
+using std::shared_ptr;
+using dcp::raw_convert;
void
SPL::read (boost::filesystem::path path, ContentStore* store)
void
SPL::read (boost::filesystem::path path, ContentStore* store)
@@
-36,16
+41,15
@@
SPL::read (boost::filesystem::path path, ContentStore* store)
cxml::Document doc ("SPL");
doc.read_file (path);
_id = doc.string_child("Id");
cxml::Document doc ("SPL");
doc.read_file (path);
_id = doc.string_child("Id");
- BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("Entry")) {
+ _name = doc.string_child("Name");
+ for (auto i: doc.node_children("Entry")) {
shared_ptr<Content> c = store->get(i->string_child("Digest"));
if (c) {
shared_ptr<Content> c = store->get(i->string_child("Digest"));
if (c) {
- add (SPLEntry(c
, i
));
+ add (SPLEntry(c));
} else {
_missing = true;
}
}
} else {
_missing = true;
}
}
-
- _name = path.filename().string();
}
void
}
void
@@
-54,7
+58,8
@@
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);
xmlpp::Document doc;
xmlpp::Element* root = doc.create_root_node ("SPL");
root->add_child("Id")->add_child_text (_id);
- BOOST_FOREACH (SPLEntry i, _spl) {
+ root->add_child("Name")->add_child_text (_name);
+ for (auto i: _spl) {
i.as_xml (root->add_child("Entry"));
}
doc.write_to_file_formatted (path.string());
i.as_xml (root->add_child("Entry"));
}
doc.write_to_file_formatted (path.string());