aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-11-16 14:26:30 +0100
committerMartin Ridgers <[email protected]>2021-11-16 14:32:21 +0100
commitb1bb51afb4ff6eac0ed65480be2127d3e06cb01a (patch)
treef0137a2d04b0eba72e17df32e8ce736a757eddc1 /zencore/filesystem.cpp
parentToUtf8() -> PathToUtf8() as the latter is less ambiguous (diff)
downloadzen-b1bb51afb4ff6eac0ed65480be2127d3e06cb01a.tar.xz
zen-b1bb51afb4ff6eac0ed65480be2127d3e06cb01a.zip
Added a PathToUtf8(path, string-buffer) overload
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 52f02b56a..4456757a6 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -728,6 +728,16 @@ ScanFile(std::filesystem::path Path, const uint64_t ChunkSize, std::function<voi
return true;
}
+void
+PathToUtf8(const std::filesystem::path& Path, StringBuilderBase& Out)
+{
+#if ZEN_PLATFORM_WINDOWS
+ WideToUtf8(Path.native().c_str(), Out);
+#else
+ Out << Path.c_str();
+#endif
+}
+
std::string
PathToUtf8(const std::filesystem::path& Path)
{