summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-06 02:04:49 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-09 01:20:01 +0200
commite4b2ebd80779a44d24fe87af26ef278c1e2d97d2 (patch)
tree3bc940c5eb49c96c3c18a896c8ccd8039e6db839 /src/cpl.cc
parent3be26a66645de04c7b220abeebfd2f024990a696 (diff)
Add wrappers around boost::filesystem methods that handle the
required mangling of long filenames on Windows. Also wrap lots of missing places (e.g. calls to asdcplib, libxml++, libcxml etc.) in dcp::filesystem::fix_long_path(). The idea is to keep paths un-mangled until they we call some filesystem-related API and mangle them at that point. Otherwise we end up serialising mangled names, which seems like it will not end well. Should fix DoM #2623.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index bbdaee18..5467fef3 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -42,6 +42,7 @@
#include "cpl.h"
#include "dcp_assert.h"
#include "equality_options.h"
+#include "filesystem.h"
#include "local_time.h"
#include "metadata.h"
#include "raw_convert.h"
@@ -108,7 +109,7 @@ CPL::CPL (boost::filesystem::path file)
, _content_kind (ContentKind::FEATURE)
{
cxml::Document f ("CompositionPlaylist");
- f.read_file (file);
+ f.read_file(dcp::filesystem::fix_long_path(file));
if (f.namespace_uri() == cpl_interop_ns) {
_standard = Standard::INTEROP;
@@ -239,7 +240,7 @@ CPL::write_xml(boost::filesystem::path file, shared_ptr<const CertificateChain>
signer->sign (root, _standard);
}
- doc.write_to_file_formatted (file.string(), "UTF-8");
+ doc.write_to_file_formatted(dcp::filesystem::fix_long_path(file).string(), "UTF-8");
set_file (file);
}