Skip to content

Commit

Permalink
make conversion of std::filesystem:path to std::string explicit (fix …
Browse files Browse the repository at this point in the history
…Windows build error)
  • Loading branch information
herzbube committed Jan 3, 2024
1 parent 84a68ed commit 107257a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SgfcUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 6 additions & 4 deletions src/SgfcUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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().
Expand Down

0 comments on commit 107257a

Please sign in to comment.