Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
71 lines (61 loc) · 1.55 KB

SDL_winrtpaths.cpp

File metadata and controls

71 lines (61 loc) · 1.55 KB
 
1
2
3
4
5
6
7
8
9
/* TODO, WinRT: include copyright info in SDL_winrtpaths.cpp
TODO, WinRT: add note to SDL_winrtpaths.cpp mentioning that /ZW must be used when compiling the file
*/
#include "SDL_config.h"
#ifdef __WINRT__
extern "C" {
Feb 3, 2013
Feb 3, 2013
10
11
#include "SDL_error.h"
#include "SDL_stdinc.h"
12
13
14
15
#include "SDL_system.h"
#include "../windows/SDL_windows.h"
}
Feb 3, 2013
Feb 3, 2013
16
#include <string>
Feb 3, 2013
Feb 3, 2013
18
19
using namespace std;
using namespace Windows::Storage;
Feb 3, 2013
Feb 3, 2013
20
Feb 3, 2013
Feb 3, 2013
21
22
23
extern "C" const wchar_t *
SDL_WinRTGetInstalledLocationPath()
{
Feb 3, 2013
Feb 3, 2013
24
25
26
static wstring path;
if (path.empty()) {
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
Feb 3, 2013
Feb 3, 2013
27
}
Feb 3, 2013
Feb 3, 2013
28
return path.c_str();
Feb 3, 2013
Feb 3, 2013
29
30
}
Feb 3, 2013
Feb 3, 2013
31
32
33
extern "C" const wchar_t *
SDL_WinRTGetLocalFolderPath()
{
Feb 3, 2013
Feb 3, 2013
34
35
36
static wstring path;
if (path.empty()) {
path = ApplicationData::Current->LocalFolder->Path->Data();
Feb 3, 2013
Feb 3, 2013
38
return path.c_str();
Feb 3, 2013
Feb 3, 2013
41
42
extern "C" const wchar_t *
SDL_WinRTGetRoamingFolderPath()
Feb 3, 2013
Feb 3, 2013
44
45
46
47
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
SDL_Unsupported();
return NULL;
#else
Feb 3, 2013
Feb 3, 2013
48
49
50
static wstring path;
if (path.empty()) {
path = ApplicationData::Current->RoamingFolder->Path->Data();
Feb 3, 2013
Feb 3, 2013
52
return path.c_str();
Feb 3, 2013
Feb 3, 2013
53
#endif
Feb 3, 2013
Feb 3, 2013
56
57
extern "C" const wchar_t *
SDL_WinRTGetTemporaryFolderPath()
Feb 3, 2013
Feb 3, 2013
59
60
61
62
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
SDL_Unsupported();
return NULL;
#else
Feb 3, 2013
Feb 3, 2013
63
64
65
static wstring path;
if (path.empty()) {
path = ApplicationData::Current->TemporaryFolder->Path->Data();
Feb 3, 2013
Feb 3, 2013
67
return path.c_str();
Feb 3, 2013
Feb 3, 2013
68
#endif
69
70
71
}
#endif /* __WINRT__ */