summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-09 21:55:15 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 20:50:32 +0200
commit7a4763153548619b379222d5c22d10b238ba0ac3 (patch)
tree9388ed2352aec643e938727bbbc9c9155d9092fb /src/lib
parent9e90111e53a0b0739d0789afd26f29e63f803917 (diff)
Convert some paths to string.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc2
-rw-r--r--src/lib/content_factory.cc8
-rw-r--r--src/lib/cross_osx.cc2
-rw-r--r--src/lib/cross_windows.cc2
-rw-r--r--src/lib/curl_uploader.cc2
-rw-r--r--src/lib/exceptions.h6
-rw-r--r--src/lib/film.cc10
-rw-r--r--src/lib/font_config.cc4
-rw-r--r--src/lib/image_examiner.cc2
-rw-r--r--src/lib/job.cc2
-rw-r--r--src/lib/kdm_cli.cc4
-rw-r--r--src/lib/map_cli.cc4
-rw-r--r--src/lib/player.cc8
-rw-r--r--src/lib/reel_writer.cc4
-rw-r--r--src/lib/scp_uploader.cc4
-rw-r--r--src/lib/uploader.cc2
-rw-r--r--src/lib/video_decoder.cc2
17 files changed, 34 insertions, 34 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 5f3f2f6fe..f2362e1a1 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -276,7 +276,7 @@ Config::backup()
auto copy_adding_number = [](path const& path_to_copy) {
auto add_number = [](path const& path, int number) {
- return String::compose("%1.%2", path, number);
+ return String::compose("%1.%2", path.string(), number);
};
int n = 1;
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index fa3f0876c..c5fbed0bd 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -117,7 +117,7 @@ content_factory (boost::filesystem::path path)
if (dcp::filesystem::is_directory(path)) {
- LOG_GENERAL ("Look in directory %1", path);
+ LOG_GENERAL("Look in directory %1", path.string());
if (dcp::filesystem::is_empty(path)) {
return content;
@@ -130,17 +130,17 @@ content_factory (boost::filesystem::path path)
int read = 0;
for (dcp::filesystem::directory_iterator i(path); i != dcp::filesystem::directory_iterator() && read < 10; ++i) {
- LOG_GENERAL ("Checking file %1", i->path());
+ LOG_GENERAL("Checking file %1", i->path().string());
if (boost::starts_with(i->path().filename().string(), ".")) {
/* We ignore hidden files */
- LOG_GENERAL ("Ignored %1 (starts with .)", i->path());
+ LOG_GENERAL("Ignored %1 (starts with .)", i->path().string());
continue;
}
if (!dcp::filesystem::is_regular_file(i->path())) {
/* Ignore things which aren't files (probably directories) */
- LOG_GENERAL ("Ignored %1 (not a regular file)", i->path());
+ LOG_GENERAL("Ignored %1 (not a regular file)", i->path().string());
continue;
}
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc
index 7d03ce1b3..92cbf4918 100644
--- a/src/lib/cross_osx.cc
+++ b/src/lib/cross_osx.cc
@@ -118,7 +118,7 @@ run_ffprobe(boost::filesystem::path content, boost::filesystem::path out, bool e
}
string const redirect = err ? "2>" : ">";
- auto const ffprobe = String::compose("\"%1\" %2 \"%3\" %4 \"%5\"", path, args.empty() ? " " : args, content.string(), redirect, out.string());
+ auto const ffprobe = String::compose("\"%1\" %2 \"%3\" %4 \"%5\"", path.string(), args.empty() ? " " : args, content.string(), redirect, out.string());
LOG_GENERAL(N_("Probing with %1"), ffprobe);
system(ffprobe.c_str());
}
diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc
index 3fdaad61a..474ffe8c5 100644
--- a/src/lib/cross_windows.cc
+++ b/src/lib/cross_windows.cc
@@ -617,7 +617,7 @@ Drive::unmount()
{
LOG_DISK("Unmounting %1 with %2 mount points", _device, _mount_points.size());
DCPOMATIC_ASSERT(_mount_points.size() == 1);
- string const device_name = String::compose("\\\\.\\%1", _mount_points.front());
+ string const device_name = String::compose("\\\\.\\%1", _mount_points.front().string());
string const truncated = device_name.substr(0, device_name.length() - 1);
LOG_DISK("Actually opening %1", truncated);
HANDLE device = CreateFileA(truncated.c_str(), (GENERIC_READ | GENERIC_WRITE), FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
diff --git a/src/lib/curl_uploader.cc b/src/lib/curl_uploader.cc
index 753c66496..791bdb3fa 100644
--- a/src/lib/curl_uploader.cc
+++ b/src/lib/curl_uploader.cc
@@ -99,7 +99,7 @@ CurlUploader::upload_file(boost::filesystem::path from, boost::filesystem::path
dcp::File file(from, "rb");
if (!file) {
- throw NetworkError(String::compose(_("Could not open %1 to send"), from));
+ throw NetworkError(String::compose(_("Could not open %1 to send"), from.string()));
}
_file = file.get();
_transferred = &transferred;
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index 31b57c92b..17a00b276 100644
--- a/src/lib/exceptions.h
+++ b/src/lib/exceptions.h
@@ -515,17 +515,17 @@ private:
std::string get_message(SQLiteDatabase& db, char const* s)
{
- return String::compose("%1 (in %2)", s, get_filename(db));
+ return String::compose("%1 (in %2)", s, get_filename(db).string());
}
std::string get_message(SQLiteDatabase& db, int rc)
{
- return String::compose("%1 (in %2)", sqlite3_errstr(rc), get_filename(db));
+ return String::compose("%1 (in %2)", sqlite3_errstr(rc), get_filename(db).string());
}
std::string get_message(SQLiteDatabase& db, int rc, std::string doing)
{
- return String::compose("%1 (while doing %2) (in %3)", sqlite3_errstr(rc), doing, get_filename(db));
+ return String::compose("%1 (while doing %2) (in %3)", sqlite3_errstr(rc), doing, get_filename(db).string());
}
boost::filesystem::path _filename;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index cdf29766d..1be1c0607 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -498,7 +498,7 @@ Film::write_metadata()
try {
metadata()->write_to_file_formatted(filename.string());
} catch (xmlpp::exception& e) {
- throw FileError(String::compose("Could not write metadata file (%1)", e.what()), filename);
+ throw FileError(String::compose("Could not write metadata file (%1)", e.what()), filename.string());
}
set_dirty(false);
}
@@ -2437,9 +2437,9 @@ Film::read_remembered_assets() const
assets.push_back(RememberedAsset(node));
}
} catch (std::exception& e) {
- LOG_ERROR("Could not read assets file %1 (%2)", filename, e.what());
+ LOG_ERROR("Could not read assets file %1 (%2)", filename.string(), e.what());
} catch (...) {
- LOG_ERROR("Could not read assets file %1", filename);
+ LOG_ERROR("Could not read assets file %1", filename.string());
}
return assets;
@@ -2459,9 +2459,9 @@ Film::write_remembered_assets(vector<RememberedAsset> const& assets) const
try {
doc->write_to_file_formatted(dcp::filesystem::fix_long_path(file(assets_file)).string());
} catch (std::exception& e) {
- LOG_ERROR("Could not write assets file %1 (%2)", file(assets_file), e.what());
+ LOG_ERROR("Could not write assets file %1 (%2)", file(assets_file).string(), e.what());
} catch (...) {
- LOG_ERROR("Could not write assets file %1", file(assets_file));
+ LOG_ERROR("Could not write assets file %1", file(assets_file).string());
}
}
diff --git a/src/lib/font_config.cc b/src/lib/font_config.cc
index 653c9ba84..8c75aff24 100644
--- a/src/lib/font_config.cc
+++ b/src/lib/font_config.cc
@@ -136,7 +136,7 @@ FontConfig::system_font_with_name(string name)
FcChar8* file;
if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) {
path = boost::filesystem::path(reinterpret_cast<char*>(file));
- LOG_GENERAL("Found %1", *path);
+ LOG_GENERAL("Found %1", path->string());
break;
}
}
@@ -149,7 +149,7 @@ FontConfig::system_font_with_name(string name)
FcPatternDestroy(pattern);
if (path) {
- LOG_GENERAL("Searched system for font %1, found %2", name, *path);
+ LOG_GENERAL("Searched system for font %1, found %2", name, path->string());
} else {
LOG_GENERAL("Searched system for font %1; nothing found", name);
}
diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc
index 16258aed5..06d9501fc 100644
--- a/src/lib/image_examiner.cc
+++ b/src/lib/image_examiner.cc
@@ -62,7 +62,7 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
try {
_video_size = dcp::decompress_j2k(buffer.data(), size, 0)->size();
} catch (dcp::ReadError& e) {
- throw DecodeError (String::compose (_("Could not decode JPEG2000 file %1 (%2)"), path, e.what ()));
+ throw DecodeError(String::compose(_("Could not decode JPEG2000 file %1 (%2)"), path.string(), e.what()));
}
} else {
FFmpegImageProxy proxy(content->path(0));
diff --git a/src/lib/job.cc b/src/lib/job.cc
index ee6ad4e70..03e505a8f 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -113,7 +113,7 @@ Job::run_wrapper ()
} catch (dcp::FileError& e) {
- string m = String::compose(_("An error occurred whilst handling the file %1."), e.filename().filename());
+ string m = String::compose(_("An error occurred whilst handling the file %1."), e.filename().filename().string());
try {
auto const s = dcp::filesystem::space(e.filename());
diff --git a/src/lib/kdm_cli.cc b/src/lib/kdm_cli.cc
index 50bf9ea51..6e3b368d0 100644
--- a/src/lib/kdm_cli.cc
+++ b/src/lib/kdm_cli.cc
@@ -176,7 +176,7 @@ write_files(
);
if (verbose) {
- out(String::compose("Wrote %1 ZIP files to %2", N, output));
+ out(String::compose("Wrote %1 ZIP files to %2", N, output.string()));
}
} else {
int const N = write_files(
@@ -185,7 +185,7 @@ write_files(
);
if (verbose) {
- out(String::compose("Wrote %1 KDM files to %2", N, output));
+ out(String::compose("Wrote %1 KDM files to %2", N, output.string()));
}
}
}
diff --git a/src/lib/map_cli.cc b/src/lib/map_cli.cc
index 20d5ce6af..d93ded220 100644
--- a/src/lib/map_cli.cc
+++ b/src/lib/map_cli.cc
@@ -151,7 +151,7 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
}
if (dcp::filesystem::exists(*output_dir)) {
- return String::compose("Output directory %1 already exists.", *output_dir);
+ return String::compose("Output directory %1 already exists.", output_dir->string());
}
if (hard_link && soft_link) {
@@ -161,7 +161,7 @@ map_cli(int argc, char* argv[], std::function<void (string)> out)
boost::system::error_code ec;
dcp::filesystem::create_directory(*output_dir, ec);
if (ec) {
- return String::compose("Could not create output directory %1: %2", *output_dir, ec.message());
+ return String::compose("Could not create output directory %1: %2", output_dir->string(), ec.message());
}
/* Find all the assets in the asset directories. This assumes that the asset directories are in fact
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 516a66ee2..8f4bc09a2 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -754,7 +754,7 @@ Player::pass()
switch (which) {
case CONTENT:
{
- LOG_DEBUG_PLAYER("Calling pass() on %1", earliest_content->content->path(0));
+ LOG_DEBUG_PLAYER("Calling pass() on %1", earliest_content->content->path(0).string());
earliest_content->done = earliest_content->decoder->pass();
auto dcp = dynamic_pointer_cast<DCPContent>(earliest_content->content);
if (dcp && !_play_referenced) {
@@ -844,14 +844,14 @@ Player::pass()
std::map<AudioStreamPtr, StreamState> alive_stream_states;
if (latest_last_push_end != have_pushed.end()) {
- LOG_DEBUG_PLAYER("Leading audio stream is in %1 at %2", latest_last_push_end->second.piece->content->path(0), to_string(latest_last_push_end->second.last_push_end.get()));
+ LOG_DEBUG_PLAYER("Leading audio stream is in %1 at %2", latest_last_push_end->second.piece->content->path(0).string(), to_string(latest_last_push_end->second.last_push_end.get()));
/* Now make a list of those streams that are less than ignore_streams_behind behind the leader */
for (auto const& i: _stream_states) {
if (!i.second.last_push_end || (latest_last_push_end->second.last_push_end.get() - i.second.last_push_end.get()) < dcpomatic::DCPTime::from_seconds(ignore_streams_behind)) {
alive_stream_states.insert(i);
} else {
- LOG_DEBUG_PLAYER("Ignoring stream %1 because it is too far behind", i.second.piece->content->path(0));
+ LOG_DEBUG_PLAYER("Ignoring stream %1 because it is too far behind", i.second.piece->content->path(0).string());
}
}
}
@@ -1162,7 +1162,7 @@ Player::audio(weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio co
/* And the end of this block in the DCP */
auto end = time + DCPTime::from_frames(content_audio.audio->frames(), rfr);
- LOG_DEBUG_PLAYER("Received audio frame %1 covering %2 to %3 (%4)", content_audio.frame, to_string(time), to_string(end), piece->content->path(0).filename());
+ LOG_DEBUG_PLAYER("Received audio frame %1 covering %2 to %3 (%4)", content_audio.frame, to_string(time), to_string(end), piece->content->path(0).filename().string());
/* Remove anything that comes before the start or after the end of the content */
if (time < piece->content->position()) {
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index bd326e853..5f6f86a00 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -171,7 +171,7 @@ ReelWriter::ReelWriter(
auto new_asset_filename = _output_dir / video_asset_filename(picture_asset, _reel_index, _reel_count, _content_summary);
if (_first_nonexistent_frame > 0) {
- LOG_GENERAL("Re-using partial asset %1: has frames up to %2", *existing_asset_filename, _first_nonexistent_frame);
+ LOG_GENERAL("Re-using partial asset %1: has frames up to %2", existing_asset_filename->string(), _first_nonexistent_frame);
dcp::filesystem::rename(*existing_asset_filename, new_asset_filename);
}
remembered_assets.push_back(RememberedAsset(new_asset_filename.filename(), period, film()->video_identifier()));
@@ -186,7 +186,7 @@ ReelWriter::ReelWriter(
}
} else {
DCPOMATIC_ASSERT(existing_asset_filename);
- LOG_GENERAL("Re-using complete asset %1", *existing_asset_filename);
+ LOG_GENERAL("Re-using complete asset %1", existing_asset_filename->string());
/* We already have a complete picture asset that we can just re-use */
/* XXX: what about if the encryption key changes? */
auto new_asset_filename = _output_dir / existing_asset_filename->filename();
diff --git a/src/lib/scp_uploader.cc b/src/lib/scp_uploader.cc
index 193894293..5f1c09ce9 100644
--- a/src/lib/scp_uploader.cc
+++ b/src/lib/scp_uploader.cc
@@ -103,7 +103,7 @@ LIBDCP_DISABLE_WARNINGS
int const r = ssh_scp_push_directory(_scp, directory.generic_string().c_str(), S_IRWXU);
LIBDCP_ENABLE_WARNINGS
if (r != SSH_OK) {
- throw NetworkError(String::compose(_("Could not create remote directory %1 (%2)"), directory, ssh_get_error(_session)));
+ throw NetworkError(String::compose(_("Could not create remote directory %1 (%2)"), directory.string(), ssh_get_error(_session)));
}
}
@@ -119,7 +119,7 @@ LIBDCP_ENABLE_WARNINGS
dcp::File f(from, "rb");
if (!f) {
- throw NetworkError(String::compose(_("Could not open %1 to send"), from));
+ throw NetworkError(String::compose(_("Could not open %1 to send"), from.string()));
}
std::vector<char> buffer(64 * 1024);
diff --git a/src/lib/uploader.cc b/src/lib/uploader.cc
index f2a47f50e..36a86819b 100644
--- a/src/lib/uploader.cc
+++ b/src/lib/uploader.cc
@@ -76,7 +76,7 @@ Uploader::upload_directory (boost::filesystem::path base, boost::filesystem::pat
if (is_directory(i.path())) {
upload_directory (base, i.path(), transferred, total_size);
} else {
- _set_status(String::compose(_("copying %1"), i.path().filename()));
+ _set_status(String::compose(_("copying %1"), i.path().filename().string()));
upload_file (i.path(), remove_prefix (base, i.path()), transferred, total_size);
}
}
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc
index c628fddd9..6363857b4 100644
--- a/src/lib/video_decoder.cc
+++ b/src/lib/video_decoder.cc
@@ -69,7 +69,7 @@ VideoDecoder::emit(shared_ptr<const Film> film, shared_ptr<const ImageProxy> ima
String::compose(
_("The content file %1 is set as 3D but does not appear to contain 3D images. Please set it to 2D. "
"You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab."),
- _content->path(0)
+ _content->path(0).string()
)
)
);