diff --git a/sago/platform_folders.cpp b/sago/platform_folders.cpp index 1c9b99c..c797177 100644 --- a/sago/platform_folders.cpp +++ b/sago/platform_folders.cpp @@ -80,6 +80,9 @@ static std::string getHome() { // For SHGetFolderPathW and various CSIDL "magic numbers" #include +namespace sago { +namespace internal { + static std::string win32_utf16_to_utf8(const wchar_t* wstr) { std::string res; // If the 6th parameter is 0 then WideCharToMultiByte returns the number of bytes needed to store the result. @@ -98,6 +101,9 @@ static std::string win32_utf16_to_utf8(const wchar_t* wstr) { return res; } +} // namesapce internal +} // namespace sago + class FreeCoTaskMemory { LPWSTR pointer = NULL; public: @@ -116,7 +122,7 @@ static std::string GetKnownWindowsFolder(REFKNOWNFOLDERID folderId, const char* if (!SUCCEEDED(hr)) { throw std::runtime_error(errorMsg); } - return win32_utf16_to_utf8(wszPath); + return sago::internal::win32_utf16_to_utf8(wszPath); } static std::string GetAppData() { diff --git a/sago/platform_folders.h b/sago/platform_folders.h index fc9dd3b..a9a6477 100644 --- a/sago/platform_folders.h +++ b/sago/platform_folders.h @@ -42,6 +42,9 @@ namespace internal { #if !defined(_WIN32) && !defined(__APPLE__) void appendExtraFoldersTokenizer(const char* envName, const char* envValue, std::vector& folders); #endif + #ifdef _WIN32 + std::string win32_utf16_to_utf8(const wchar_t* wstr); + #endif } #endif //DOXYGEN_SHOULD_SKIP_THIS