diff options
Diffstat (limited to 'src/PlatformUtils-win32.cc')
-rw-r--r-- | src/PlatformUtils-win32.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/PlatformUtils-win32.cc b/src/PlatformUtils-win32.cc new file mode 100644 index 0000000..61382dd --- /dev/null +++ b/src/PlatformUtils-win32.cc @@ -0,0 +1,15 @@ +#include "PlatformUtils.h" +#include <windows.h> +#include <shlobj.h> + +std::string PlatformUtils::documentsPath() +{ + std::string retval; + CHAR my_documents[MAX_PATH]; + HRESULT result = SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, + SHGFP_TYPE_CURRENT, my_documents); + + if (result != S_OK) retval = ""; + else retval = my_documents; + return retval; +} |