From e4b2ebd80779a44d24fe87af26ef278c1e2d97d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 6 Oct 2023 02:04:49 +0200 Subject: 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. --- src/cpl.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cpl.cc') 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 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); } -- cgit v1.2.3