From 107257a6c9569afc179aca83bb4cecf5be421926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Na=CC=88f?= Date: Wed, 3 Jan 2024 17:23:11 +0100 Subject: [PATCH] make conversion of std::filesystem:path to std::string explicit (fix Windows build error) --- src/SgfcUtility.cpp | 2 +- src/SgfcUtility.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/SgfcUtility.cpp b/src/SgfcUtility.cpp index d5091e1..7caf818 100644 --- a/src/SgfcUtility.cpp +++ b/src/SgfcUtility.cpp @@ -190,7 +190,7 @@ namespace LibSgfcPlusPlus std::string SgfcUtility::GetTempFolderPath() { std::filesystem::path tempFolderPath = std::filesystem::temp_directory_path(); - return tempFolderPath; + return tempFolderPath.u8string(); } std::string SgfcUtility::GetUniqueTempFileName() diff --git a/src/SgfcUtility.h b/src/SgfcUtility.h index b311cb0..b3e70e7 100644 --- a/src/SgfcUtility.h +++ b/src/SgfcUtility.h @@ -155,8 +155,9 @@ namespace LibSgfcPlusPlus /// SgfcPrivateConstants::ArgumentTypeToCmdlineOptionMap. static std::string MapArgumentTypeToCmdlineOption(SgfcArgumentType argumentType); - /// @brief Returns the full path to a folder that is suitable for temporary - /// files. The path is guaranteed to exist and to be a directory. + /// @brief Returns the full path of a folder that is suitable for temporary + /// files. The path is guaranteed to exist and to be a directory. The + /// returned path string is UTF-8 encoded. /// /// The implementation makes use of std::filesystem::temp_directory_path(), /// which is defined in C++17 but may not be available on older platform @@ -182,9 +183,10 @@ namespace LibSgfcPlusPlus /// file static std::string GetUniqueTempFileName(); - /// @brief Returns the unique absolute path name of a file that is extremely + /// @brief Returns the unique absolute path of a file that is extremely /// unlikely to already exist in the temporary folder returned by - /// GetTempPath(). This method never returns the same value twice. + /// GetTempPath(). The returned path string is UTF-8 encoded. This method + /// never returns the same value twice. /// /// This is a convenience function that invokes JoinPathComponents() using /// the return values of GetTempFolderPath() and GetUniqueTempFileName().