diff options
Diffstat (limited to 'SwifTools/Application/WindowsApplicationPathProvider.cpp')
| -rw-r--r-- | SwifTools/Application/WindowsApplicationPathProvider.cpp | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/SwifTools/Application/WindowsApplicationPathProvider.cpp b/SwifTools/Application/WindowsApplicationPathProvider.cpp index 8514fa7..730a57a 100644 --- a/SwifTools/Application/WindowsApplicationPathProvider.cpp +++ b/SwifTools/Application/WindowsApplicationPathProvider.cpp @@ -7,6 +7,7 @@  #include <SwifTools/Application/WindowsApplicationPathProvider.h>  #include <windows.h> +#include <cassert>  namespace Swift { @@ -15,4 +16,20 @@ WindowsApplicationPathProvider::WindowsApplicationPathProvider(const std::string  	resourceDirs.push_back(getExecutableDir() / "../resources"); // Development  } +boost::filesystem::path WindowsApplicationPathProvider::getDataDir() const { +	char* appDirRaw = getenv("APPDATA"); +	assert(appDirRaw); +	boost::filesystem::path result(boost::filesystem::path(appDirRaw) / getApplicationName()); +	boost::filesystem::create_directory(result); +	return result; +} + +boost::filesystem::path WindowsApplicationPathProvider::getHomeDir() const { +	//FIXME: This should be My Documents  +	char* homeDirRaw = getenv("USERPROFILE"); +	assert(homeDirRaw); +	return boost::filesystem::path(homeDirRaw); +} + +  } | 
 Swift
 Swift