projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix font ID allocation from DCP when there are subs and ccaps using the same IDs...
[dcpomatic.git]
/
src
/
lib
/
spl.cc
diff --git
a/src/lib/spl.cc
b/src/lib/spl.cc
index 1677e626ff07ddf5cd25fb478aecdcd8da9075ed..f49f11a7d26ac15cb8b1429b6bd64b36ee3618ac 100644
(file)
--- a/
src/lib/spl.cc
+++ b/
src/lib/spl.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018-20
19
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-20
21
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,32
+18,36
@@
*/
*/
+
#include "content_store.h"
#include "spl.h"
#include "content_store.h"
#include "spl.h"
-#include "warnings.h"
#include <libcxml/cxml.h>
#include <libcxml/cxml.h>
+#include <dcp/filesystem.h>
#include <dcp/raw_convert.h>
#include <dcp/raw_convert.h>
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
#include <libxml++/libxml++.h>
-
DCPOMATIC
_ENABLE_WARNINGS
+
LIBDCP
_ENABLE_WARNINGS
#include <iostream>
#include <iostream>
+
using std::cout;
using std::string;
using std::shared_ptr;
using dcp::raw_convert;
using std::cout;
using std::string;
using std::shared_ptr;
using dcp::raw_convert;
+
void
SPL::read (boost::filesystem::path path, ContentStore* store)
{
_spl.clear ();
_missing = false;
cxml::Document doc ("SPL");
void
SPL::read (boost::filesystem::path path, ContentStore* store)
{
_spl.clear ();
_missing = false;
cxml::Document doc ("SPL");
- doc.read_file
(path
);
+ doc.read_file
(dcp::filesystem::fix_long_path(path)
);
_id = doc.string_child("Id");
_name = doc.string_child("Name");
for (auto i: doc.node_children("Entry")) {
_id = doc.string_child("Id");
_name = doc.string_child("Name");
for (auto i: doc.node_children("Entry")) {
-
shared_ptr<Content>
c = store->get(i->string_child("Digest"));
+
auto
c = store->get(i->string_child("Digest"));
if (c) {
add (SPLEntry(c));
} else {
if (c) {
add (SPLEntry(c));
} else {
@@
-52,11
+56,12
@@
SPL::read (boost::filesystem::path path, ContentStore* store)
}
}
}
}
+
void
SPL::write (boost::filesystem::path path) const
{
xmlpp::Document doc;
void
SPL::write (boost::filesystem::path path) const
{
xmlpp::Document doc;
-
xmlpp::Element*
root = doc.create_root_node ("SPL");
+
auto
root = doc.create_root_node ("SPL");
root->add_child("Id")->add_child_text (_id);
root->add_child("Name")->add_child_text (_name);
for (auto i: _spl) {
root->add_child("Id")->add_child_text (_id);
root->add_child("Name")->add_child_text (_name);
for (auto i: _spl) {