summaryrefslogtreecommitdiff
path: root/src/PlatformUtils-win32.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-05-21 21:45:24 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-21 21:45:24 (GMT)
commite2772c70b862e3669c3a279f2540d746438ec38d (patch)
treeac2505cacb5289b9e9c217a66ef75a54748a25b0 /src/PlatformUtils-win32.cc
parentf8622005f89c52061f498ab6ec28adfbd332c344 (diff)
Initial Windows implementation of built-in library path. Part of #125
Diffstat (limited to 'src/PlatformUtils-win32.cc')
-rw-r--r--src/PlatformUtils-win32.cc15
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;
+}
contact: Jan Huwald // Impressum