21 #include "../../SDL_internal.h" 34 #include "../../core/windows/SDL_windows.h" 38 #include <unordered_map> 41 using namespace Windows::Storage;
43 extern "C" const wchar_t *
47 case SDL_WINRT_PATH_INSTALLED_LOCATION:
51 path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
56 case SDL_WINRT_PATH_LOCAL_FOLDER:
60 path = ApplicationData::Current->LocalFolder->Path->Data();
65 #if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) 66 case SDL_WINRT_PATH_ROAMING_FOLDER:
70 path = ApplicationData::Current->RoamingFolder->Path->Data();
75 case SDL_WINRT_PATH_TEMP_FOLDER:
79 path = ApplicationData::Current->TemporaryFolder->Path->Data();
93 extern "C" const char *
96 typedef unordered_map<SDL_WinRT_Path, string> UTF8PathMap;
97 static UTF8PathMap utf8Paths;
99 UTF8PathMap::iterator searchResult = utf8Paths.find(pathType);
100 if (searchResult != utf8Paths.end()) {
101 return searchResult->second.c_str();
110 utf8Paths[pathType] = utf8Path;
112 return utf8Paths[pathType].c_str();
120 char * destPath =
NULL;
147 const WCHAR * srcPath =
NULL;
148 WCHAR path[MAX_PATH];
152 size_t new_wpath_len = 0;
153 BOOL api_result =
FALSE;
190 if ((new_wpath_len + 1) > MAX_PATH) {
203 api_result = CreateDirectoryW(path,
NULL);
204 if (api_result ==
FALSE) {
205 if (GetLastError() != ERROR_ALREADY_EXISTS) {
216 api_result = CreateDirectoryW(path,
NULL);
217 if (api_result ==
FALSE) {
218 if (GetLastError() != ERROR_ALREADY_EXISTS) {
#define WIN_UTF8ToString(S)
#define SDL_InvalidParamError(param)
#define WIN_StringToUTF8(S)
#define SDL_OutOfMemory()
int WIN_SetError(const char *prefix)
Include file for filesystem SDL API functions.
#define SDL_WinRTGetFSPathUTF8
#define SDL_arraysize(array)
GLsizei const GLchar *const * path
#define SDL_WinRTGetFSPathUNICODE
char * SDL_GetBasePath(void)
Get the path where the application resides.
#define SDL_Unsupported()