21#include "../../SDL_internal.h"
34#include "../../core/windows/SDL_windows.h"
38#include <unordered_map>
41using namespace Windows::Storage;
43extern "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();
93extern "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;
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 SDL_WinRTGetFSPathUNICODE
#define SDL_WinRTGetFSPathUTF8
#define SDL_OutOfMemory()
#define SDL_Unsupported()
#define SDL_InvalidParamError(param)
Include file for filesystem SDL API functions.
char * SDL_GetBasePath(void)
Get the path where the application resides.
GLsizei const GLchar *const * path
#define SDL_arraysize(array)
#define WIN_UTF8ToString(S)
#define WIN_StringToUTF8(S)
int WIN_SetError(const char *prefix)