From bd06118b2980f3a9bce11949483f99f3d86ce739 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sun, 21 Sep 2025 12:34:38 +0200 Subject: [PATCH 1/3] Normalize paths created by the RelativeFileSystemAdapter. Fixes issues with trailin "/.". --- source/mijin/virtual_filesystem/relative.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mijin/virtual_filesystem/relative.hpp b/source/mijin/virtual_filesystem/relative.hpp index 5a024db..795d956 100644 --- a/source/mijin/virtual_filesystem/relative.hpp +++ b/source/mijin/virtual_filesystem/relative.hpp @@ -97,7 +97,7 @@ fs::path RelativeFileSystemAdapter::appendPath(const fs::path& other) else { combinedPath /= other; } - return combinedPath; + return combinedPath.lexically_normal(); } namespace vfs_pipe From 7da2f7b7f438551d7a554ed237511a38b046cf84 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sun, 21 Sep 2025 12:35:46 +0200 Subject: [PATCH 2/3] Added note about getKnownFolder() to getHomeFolder() deprecation hint. --- source/mijin/virtual_filesystem/filesystem.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mijin/virtual_filesystem/filesystem.hpp b/source/mijin/virtual_filesystem/filesystem.hpp index bd1322c..8668e27 100644 --- a/source/mijin/virtual_filesystem/filesystem.hpp +++ b/source/mijin/virtual_filesystem/filesystem.hpp @@ -80,7 +80,7 @@ class FileSystemAdapter public: virtual ~FileSystemAdapter() = default; - [[deprecated("Will be removed ASAP")]] + [[deprecated("Will be removed ASAP, use getKnownFolder(KnownFolder::USER_HOME) from platform/folders.hpp instead.")]] [[nodiscard]] virtual fs::path getHomeFolder() { return {}; } // TODO: get rid of this ... [[nodiscard]] virtual std::vector listFiles(const fs::path& folder) = 0; [[nodiscard]] virtual FileInfo getFileInfo(const fs::path& file) = 0; From 3891c0f8ce17e7682f62311544c15447bbee36ce Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sun, 21 Sep 2025 12:36:41 +0200 Subject: [PATCH 3/3] Added option to quoted() function to replace newlines. --- source/mijin/util/string.hpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/source/mijin/util/string.hpp b/source/mijin/util/string.hpp index f8fd9c1..f522602 100644 --- a/source/mijin/util/string.hpp +++ b/source/mijin/util/string.hpp @@ -1021,7 +1021,12 @@ bool convertStringType(const TFrom* strFrom, std::basic_string(strFrom), outString); } -template> +struct StringQuoteOptions +{ + bool replaceNewlines = false; +}; + +template> std::basic_string quoted(std::basic_string_view input) { std::basic_string result; @@ -1029,8 +1034,28 @@ std::basic_string quoted(std::basic_string_view quoted(std::basic_string_view +template std::basic_string quoted(const std::basic_string& input) { - return quoted(std::basic_string_view(input)); + return quoted(std::basic_string_view(input)); } } // namespace mijin