git repos / PlatformFolders

blame: sago/platform_folders.h

normal view · raw

1213f3f3 sago007 2015-09-19 19:24 1
/*
84975644 Poul Sander 2025-12-10 16:34 2
It is under the MIT license, to encourage reuse by cut-and-paste.
1213f3f3 sago007 2015-09-19 19:24 3
d2b67cec sago007 2018-03-24 09:52 4
The original files are hosted here: https://github.com/sago007/PlatformFolders
1ff6644e sago007 2018-02-18 16:28 5
d2b67cec sago007 2018-03-24 09:52 6
Copyright (c) 2015 Poul Sander
1213f3f3 sago007 2015-09-19 19:24 7
d2b67cec sago007 2018-03-24 09:52 8
Permission is hereby granted, free of charge, to any person
d2b67cec sago007 2018-03-24 09:52 9
obtaining a copy of this software and associated documentation files
d2b67cec sago007 2018-03-24 09:52 10
(the "Software"), to deal in the Software without restriction,
d2b67cec sago007 2018-03-24 09:52 11
including without limitation the rights to use, copy, modify, merge,
d2b67cec sago007 2018-03-24 09:52 12
publish, distribute, sublicense, and/or sell copies of the Software,
d2b67cec sago007 2018-03-24 09:52 13
and to permit persons to whom the Software is furnished to do so,
d2b67cec sago007 2018-03-24 09:52 14
subject to the following conditions:
1213f3f3 sago007 2015-09-19 19:24 15
d2b67cec sago007 2018-03-24 09:52 16
The above copyright notice and this permission notice shall be
d2b67cec sago007 2018-03-24 09:52 17
included in all copies or substantial portions of the Software.
1213f3f3 sago007 2015-09-19 19:24 18
d2b67cec sago007 2018-03-24 09:52 19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
d2b67cec sago007 2018-03-24 09:52 20
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d2b67cec sago007 2018-03-24 09:52 21
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
d2b67cec sago007 2018-03-24 09:52 22
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
d2b67cec sago007 2018-03-24 09:52 23
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
d2b67cec sago007 2018-03-24 09:52 24
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
d2b67cec sago007 2018-03-24 09:52 25
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
d2b67cec sago007 2018-03-24 09:52 26
SOFTWARE.
1213f3f3 sago007 2015-09-19 19:24 27
*/
1213f3f3 sago007 2015-09-19 19:24 28
1213f3f3 sago007 2015-09-19 19:24 29
#ifndef SAGO_PLATFORM_FOLDERS_H
d2b67cec sago007 2018-03-24 09:52 30
#define SAGO_PLATFORM_FOLDERS_H
1213f3f3 sago007 2015-09-19 19:24 31
1213f3f3 sago007 2015-09-19 19:24 32
#include <vector>
1213f3f3 sago007 2015-09-19 19:24 33
#include <string>
1213f3f3 sago007 2015-09-19 19:24 34
1213f3f3 sago007 2015-09-19 19:24 35
/**
84975644 Poul Sander 2025-12-10 16:34 36
 * The namespace I use for common functions. Nothing special about it.
1213f3f3 sago007 2015-09-19 19:24 37
 */
1213f3f3 sago007 2015-09-19 19:24 38
namespace sago {
1213f3f3 sago007 2015-09-19 19:24 39
df5fd138 Poul Sander 2019-02-13 16:35 40
#ifndef DOXYGEN_SHOULD_SKIP_THIS
df5fd138 Poul Sander 2019-02-13 16:35 41
namespace internal {
c7c13350 sum01 2019-03-06 18:59 42
#if !defined(_WIN32) && !defined(__APPLE__)
c7c13350 sum01 2019-03-06 18:59 43
void appendExtraFoldersTokenizer(const char* envName, const char* envValue, std::vector<std::string>& folders);
c7c13350 sum01 2019-03-06 18:59 44
#endif
c7c13350 sum01 2019-03-06 18:59 45
#ifdef _WIN32
c7c13350 sum01 2019-03-06 18:59 46
std::string win32_utf16_to_utf8(const wchar_t* wstr);
c7c13350 sum01 2019-03-06 18:59 47
#endif
42748e0d Poul Sander 2025-04-22 18:11 48
#ifndef _WIN32
42748e0d Poul Sander 2025-04-22 18:11 49
std::string getHome();
42748e0d Poul Sander 2025-04-22 18:11 50
#endif
df5fd138 Poul Sander 2019-02-13 16:35 51
}
df5fd138 Poul Sander 2019-02-13 16:35 52
#endif  //DOXYGEN_SHOULD_SKIP_THIS
df5fd138 Poul Sander 2019-02-13 16:35 53
1213f3f3 sago007 2015-09-19 19:24 54
/**
84975644 Poul Sander 2025-12-10 16:34 55
 * Retrieves the base folder for storing data files.
1213f3f3 sago007 2015-09-19 19:24 56
 * You must add the program name yourself like this:
1213f3f3 sago007 2015-09-19 19:24 57
 * @code{.cpp}
1213f3f3 sago007 2015-09-19 19:24 58
 * string data_home = getDataHome()+"/My Program Name/";
1213f3f3 sago007 2015-09-19 19:24 59
 * @endcode
1213f3f3 sago007 2015-09-19 19:24 60
 * On Windows this defaults to %APPDATA% (Roaming profile)
46675c1a Poul Sander 2022-01-23 14:46 61
 * On Linux this defaults to ~/.local/share but can be configured by the user
6b50949e sago007 2018-06-24 14:45 62
 * @return The base folder for storing program data.
1213f3f3 sago007 2015-09-19 19:24 63
 */
1213f3f3 sago007 2015-09-19 19:24 64
std::string getDataHome();
0fd23ef9 sago007 2018-05-22 17:49 65
1213f3f3 sago007 2015-09-19 19:24 66
/**
84975644 Poul Sander 2025-12-10 16:34 67
 * Retrieves the base folder for storing config files.
1213f3f3 sago007 2015-09-19 19:24 68
 * You must add the program name yourself like this:
1213f3f3 sago007 2015-09-19 19:24 69
 * @code{.cpp}
1213f3f3 sago007 2015-09-19 19:24 70
 * string data_home = getConfigHome()+"/My Program Name/";
1213f3f3 sago007 2015-09-19 19:24 71
 * @endcode
1213f3f3 sago007 2015-09-19 19:24 72
 * On Windows this defaults to %APPDATA% (Roaming profile)
46675c1a Poul Sander 2022-01-23 14:46 73
 * On Linux this defaults to ~/.config but can be configured by the user
6b50949e sago007 2018-06-24 14:45 74
 * @return The base folder for storing config data.
1213f3f3 sago007 2015-09-19 19:24 75
 */
1213f3f3 sago007 2015-09-19 19:24 76
std::string getConfigHome();
0fd23ef9 sago007 2018-05-22 17:49 77
1213f3f3 sago007 2015-09-19 19:24 78
/**
84975644 Poul Sander 2025-12-10 16:34 79
 * Retrieves the base folder for storing cache files.
1213f3f3 sago007 2015-09-19 19:24 80
 * You must add the program name yourself like this:
1213f3f3 sago007 2015-09-19 19:24 81
 * @code{.cpp}
46675c1a Poul Sander 2022-01-23 14:46 82
 * string data_home = getCacheDir()+"/My Program Name/cache/";
1213f3f3 sago007 2015-09-19 19:24 83
 * @endcode
1213f3f3 sago007 2015-09-19 19:24 84
 * On Windows this defaults to %APPDATALOCAL%
46675c1a Poul Sander 2022-01-23 14:46 85
 * On Linux this defaults to ~/.cache but can be configured by the user
46675c1a Poul Sander 2022-01-23 14:46 86
 * Note that it is recommended to append "cache" after the program name to prevent conflicting with "StateDir" under Windows
46675c1a Poul Sander 2022-01-23 14:46 87
 * @return The base folder for storing data that do not need to be backed up and might be deleted.
1213f3f3 sago007 2015-09-19 19:24 88
 */
1213f3f3 sago007 2015-09-19 19:24 89
std::string getCacheDir();
0fd23ef9 sago007 2018-05-22 17:49 90
1213f3f3 sago007 2015-09-19 19:24 91
/**
84975644 Poul Sander 2025-12-10 16:34 92
 * Retrieves the base folder used for state files.
46675c1a Poul Sander 2022-01-23 14:46 93
 * You must add the program name yourself like this:
46675c1a Poul Sander 2022-01-23 14:46 94
 * @code{.cpp}
46675c1a Poul Sander 2022-01-23 14:46 95
 * string data_home = getStateDir()+"/My Program Name/";
46675c1a Poul Sander 2022-01-23 14:46 96
 * @endcode
46675c1a Poul Sander 2022-01-23 14:46 97
 * On Windows this defaults to %APPDATALOCAL%
46675c1a Poul Sander 2022-01-23 14:46 98
 * On Linux this defaults to ~/.local/state but can be configured by the user
46675c1a Poul Sander 2022-01-23 14:46 99
 * On OS X this is the same as getDataHome()
84975644 Poul Sander 2025-12-10 16:34 100
 * @return The base folder for storing data that do not need to be backed up but should not be regularly deleted either.
46675c1a Poul Sander 2022-01-23 14:46 101
 */
46675c1a Poul Sander 2022-01-23 14:46 102
std::string getStateDir();
46675c1a Poul Sander 2022-01-23 14:46 103
46675c1a Poul Sander 2022-01-23 14:46 104
/**
1213f3f3 sago007 2015-09-19 19:24 105
 * This will append extra folders that your program should be looking for data files in.
84975644 Poul Sander 2025-12-10 16:34 106
 * This does not normally include the path returned by getDataHome().
1213f3f3 sago007 2015-09-19 19:24 107
 * If you want all the folders you should do something like:
1213f3f3 sago007 2015-09-19 19:24 108
 * @code{.cpp}
1213f3f3 sago007 2015-09-19 19:24 109
 * vector<string> folders;
1213f3f3 sago007 2015-09-19 19:24 110
 * folders.push_back(getDataHome());
1213f3f3 sago007 2015-09-19 19:24 111
 * appendAdditionalDataDirectories(folders);
84975644 Poul Sander 2025-12-10 16:34 112
 * for (string& s : folders) {
1213f3f3 sago007 2015-09-19 19:24 113
 *     s+="/My Program Name/";
1213f3f3 sago007 2015-09-19 19:24 114
 * }
1213f3f3 sago007 2015-09-19 19:24 115
 * @endcode
1213f3f3 sago007 2015-09-19 19:24 116
 * You must apply "/My Program Name/" to all the strings.
1213f3f3 sago007 2015-09-19 19:24 117
 * The string at the lowest index has the highest priority.
1213f3f3 sago007 2015-09-19 19:24 118
 * @param homes A vector that extra folders will be appended to.
1213f3f3 sago007 2015-09-19 19:24 119
 */
1213f3f3 sago007 2015-09-19 19:24 120
void appendAdditionalDataDirectories(std::vector<std::string>& homes);
0fd23ef9 sago007 2018-05-22 17:49 121
1213f3f3 sago007 2015-09-19 19:24 122
/**
1213f3f3 sago007 2015-09-19 19:24 123
 * This will append extra folders that your program should be looking for config files in.
84975644 Poul Sander 2025-12-10 16:34 124
 * This does not normally include the path returned by getConfigHome().
1213f3f3 sago007 2015-09-19 19:24 125
 * If you want all the folders you should do something like:
1213f3f3 sago007 2015-09-19 19:24 126
 * @code{.cpp}
9ad3df57 Poul Sander 2016-09-02 20:14 127
 * std::vector<std::string> folders;
9ad3df57 Poul Sander 2016-09-02 20:14 128
 * folders.push_back(sago::getConfigHome());
9ad3df57 Poul Sander 2016-09-02 20:14 129
 * sago::appendAdditionalConfigDirectories(folders);
84975644 Poul Sander 2025-12-10 16:34 130
 * for (std::string& s : folders) {
1213f3f3 sago007 2015-09-19 19:24 131
 *     s+="/My Program Name/";
1213f3f3 sago007 2015-09-19 19:24 132
 * }
1213f3f3 sago007 2015-09-19 19:24 133
 * @endcode
1213f3f3 sago007 2015-09-19 19:24 134
 * You must apply "/My Program Name/" to all the strings.
1213f3f3 sago007 2015-09-19 19:24 135
 * The string at the lowest index has the highest priority.
1213f3f3 sago007 2015-09-19 19:24 136
 * @param homes A vector that extra folders will be appended to.
1213f3f3 sago007 2015-09-19 19:24 137
 */
1213f3f3 sago007 2015-09-19 19:24 138
void appendAdditionalConfigDirectories(std::vector<std::string>& homes);
1213f3f3 sago007 2015-09-19 19:24 139
1213f3f3 sago007 2015-09-19 19:24 140
/**
0fd23ef9 sago007 2018-05-22 17:49 141
 * The folder that represents the desktop.
0fd23ef9 sago007 2018-05-22 17:49 142
 * Normally you should try not to use this folder.
0fd23ef9 sago007 2018-05-22 17:49 143
 * @return Absolute path to the user's desktop
0fd23ef9 sago007 2018-05-22 17:49 144
 */
0fd23ef9 sago007 2018-05-22 17:49 145
std::string getDesktopFolder();
0fd23ef9 sago007 2018-05-22 17:49 146
0fd23ef9 sago007 2018-05-22 17:49 147
/**
0fd23ef9 sago007 2018-05-22 17:49 148
 * The folder to store user documents to
0fd23ef9 sago007 2018-05-22 17:49 149
 * @return Absolute path to the "Documents" folder
0fd23ef9 sago007 2018-05-22 17:49 150
 */
0fd23ef9 sago007 2018-05-22 17:49 151
std::string getDocumentsFolder();
0fd23ef9 sago007 2018-05-22 17:49 152
0fd23ef9 sago007 2018-05-22 17:49 153
/**
0fd23ef9 sago007 2018-05-22 17:49 154
 * The folder where files are downloaded.
513c0ebf Poul Sander 2018-06-06 17:05 155
 * @return Absolute path to the folder where files are downloaded to.
513c0ebf Poul Sander 2018-06-06 17:05 156
 */
513c0ebf Poul Sander 2018-06-06 17:05 157
std::string getDownloadFolder();
513c0ebf Poul Sander 2018-06-06 17:05 158
513c0ebf Poul Sander 2018-06-06 17:05 159
/**
513c0ebf Poul Sander 2018-06-06 17:05 160
 * The folder where files are downloaded.
513c0ebf Poul Sander 2018-06-06 17:05 161
 * @note This is provided for backward compatibility. Use getDownloadFolder instead.
0fd23ef9 sago007 2018-05-22 17:49 162
 * @return Absolute path to the folder where files are downloaded to.
0fd23ef9 sago007 2018-05-22 17:49 163
 */
0fd23ef9 sago007 2018-05-22 17:49 164
std::string getDownloadFolder1();
0fd23ef9 sago007 2018-05-22 17:49 165
0fd23ef9 sago007 2018-05-22 17:49 166
/**
6b50949e sago007 2018-06-24 14:45 167
 * The folder for storing the user's pictures.
0fd23ef9 sago007 2018-05-22 17:49 168
 * @return Absolute path to the "Picture" folder
0fd23ef9 sago007 2018-05-22 17:49 169
 */
0fd23ef9 sago007 2018-05-22 17:49 170
std::string getPicturesFolder();
0fd23ef9 sago007 2018-05-22 17:49 171
0fd23ef9 sago007 2018-05-22 17:49 172
/**
5612f69b sago007 2018-06-16 11:22 173
 * This returns the folder that can be used for sharing files with other users on the same system.
5612f69b sago007 2018-06-16 11:22 174
 * @return Absolute path to the "Public" folder
5612f69b sago007 2018-06-16 11:22 175
 */
5612f69b sago007 2018-06-16 11:22 176
std::string getPublicFolder();
5612f69b sago007 2018-06-16 11:22 177
5612f69b sago007 2018-06-16 11:22 178
/**
0fd23ef9 sago007 2018-05-22 17:49 179
 * The folder where music is stored
0fd23ef9 sago007 2018-05-22 17:49 180
 * @return Absolute path to the music folder
0fd23ef9 sago007 2018-05-22 17:49 181
 */
0fd23ef9 sago007 2018-05-22 17:49 182
std::string getMusicFolder();
0fd23ef9 sago007 2018-05-22 17:49 183
0fd23ef9 sago007 2018-05-22 17:49 184
/**
0fd23ef9 sago007 2018-05-22 17:49 185
 * The folder where video is stored
0fd23ef9 sago007 2018-05-22 17:49 186
 * @return Absolute path to the video folder
0fd23ef9 sago007 2018-05-22 17:49 187
 */
0fd23ef9 sago007 2018-05-22 17:49 188
std::string getVideoFolder();
0fd23ef9 sago007 2018-05-22 17:49 189
0fd23ef9 sago007 2018-05-22 17:49 190
/**
6b50949e sago007 2018-06-24 14:45 191
 * A base folder for storing saved games.
0fd23ef9 sago007 2018-05-22 17:49 192
 * You must add the program name to it like this:
0fd23ef9 sago007 2018-05-22 17:49 193
 * @code{.cpp}
be6a67eb sago007 2018-05-27 13:12 194
 * string saved_games_folder = sago::getSaveGamesFolder1()+"/My Program Name/";
0fd23ef9 sago007 2018-05-22 17:49 195
 * @endcode
0fd23ef9 sago007 2018-05-22 17:49 196
 * @note Windows: This is an XP compatible version and returns the path to "My Games" in Documents. Vista and later has an official folder.
84975644 Poul Sander 2025-12-10 16:34 197
 * @note Linux: XDG does not define a folder for saved games. This will just return the same as getDataHome()
84975644 Poul Sander 2025-12-10 16:34 198
 * @return The base folder for storing save games.
0fd23ef9 sago007 2018-05-22 17:49 199
 */
0fd23ef9 sago007 2018-05-22 17:49 200
std::string getSaveGamesFolder1();
0fd23ef9 sago007 2018-05-22 17:49 201
513c0ebf Poul Sander 2018-06-06 17:05 202
/**
6b50949e sago007 2018-06-24 14:45 203
 * A base folder for storing saved games.
513c0ebf Poul Sander 2018-06-06 17:05 204
 * You must add the program name to it like this:
513c0ebf Poul Sander 2018-06-06 17:05 205
 * @code{.cpp}
513c0ebf Poul Sander 2018-06-06 17:05 206
 * string saved_games_folder = sago::getSaveGamesFolder2()+"/My Program Name/";
513c0ebf Poul Sander 2018-06-06 17:05 207
 * @endcode
84975644 Poul Sander 2025-12-10 16:34 208
 * @note PlatformFolders provides different folders for saved games as not all operating systems has support for Saved Games yet.
513c0ebf Poul Sander 2018-06-06 17:05 209
 * It is recommended to pick the highest number (currently getSaveGamesFolder2) at the time your product enters production and stick with it
513c0ebf Poul Sander 2018-06-06 17:05 210
 * @note Windows: This returns the "Saved Games" folder. This folder exist in Vista and later
84975644 Poul Sander 2025-12-10 16:34 211
 * @note Linux: XDG does not define a folder for saved games. This will just return the same as getDataHome()
84975644 Poul Sander 2025-12-10 16:34 212
 * @return The base folder for storing save games.
513c0ebf Poul Sander 2018-06-06 17:05 213
 */
513c0ebf Poul Sander 2018-06-06 17:05 214
std::string getSaveGamesFolder2();
513c0ebf Poul Sander 2018-06-06 17:05 215
0fd23ef9 sago007 2018-05-22 17:49 216
#ifndef DOXYGEN_SHOULD_SKIP_THIS
0fd23ef9 sago007 2018-05-22 17:49 217
0fd23ef9 sago007 2018-05-22 17:49 218
/**
84975644 Poul Sander 2025-12-10 16:34 219
 * This class contains methods for finding the system-dependent special folders.
1213f3f3 sago007 2015-09-19 19:24 220
 * For Windows these folders are either by convention or given by CSIDL.
1213f3f3 sago007 2015-09-19 19:24 221
 * For Linux XDG convention is used.
1213f3f3 sago007 2015-09-19 19:24 222
 * The Linux version has very little error checking and assumes that the config is correct
1213f3f3 sago007 2015-09-19 19:24 223
 */
1213f3f3 sago007 2015-09-19 19:24 224
class PlatformFolders {
1213f3f3 sago007 2015-09-19 19:24 225
public:
1213f3f3 sago007 2015-09-19 19:24 226
	PlatformFolders();
1213f3f3 sago007 2015-09-19 19:24 227
	~PlatformFolders();
1213f3f3 sago007 2015-09-19 19:24 228
	/**
1213f3f3 sago007 2015-09-19 19:24 229
	 * The folder that represents the desktop.
1213f3f3 sago007 2015-09-19 19:24 230
	 * Normally you should try not to use this folder.
1213f3f3 sago007 2015-09-19 19:24 231
	 * @return Absolute path to the user's desktop
1213f3f3 sago007 2015-09-19 19:24 232
	 */
1213f3f3 sago007 2015-09-19 19:24 233
	std::string getDesktopFolder() const;
1213f3f3 sago007 2015-09-19 19:24 234
	/**
1213f3f3 sago007 2015-09-19 19:24 235
	 * The folder to store user documents to
1213f3f3 sago007 2015-09-19 19:24 236
	 * @return Absolute path to the "Documents" folder
1213f3f3 sago007 2015-09-19 19:24 237
	 */
1213f3f3 sago007 2015-09-19 19:24 238
	std::string getDocumentsFolder() const;
1213f3f3 sago007 2015-09-19 19:24 239
	/**
6b50949e sago007 2018-06-24 14:45 240
	 * The folder for storing the user's pictures.
1213f3f3 sago007 2015-09-19 19:24 241
	 * @return Absolute path to the "Picture" folder
1213f3f3 sago007 2015-09-19 19:24 242
	 */
1213f3f3 sago007 2015-09-19 19:24 243
	std::string getPicturesFolder() const;
1213f3f3 sago007 2015-09-19 19:24 244
	/**
c7c13350 sum01 2019-03-06 18:59 245
	 * Use sago::getPublicFolder() instead!
5612f69b sago007 2018-06-16 11:22 246
	 */
5612f69b sago007 2018-06-16 11:22 247
	std::string getPublicFolder() const;
5612f69b sago007 2018-06-16 11:22 248
	/**
1213f3f3 sago007 2015-09-19 19:24 249
	 * The folder where files are downloaded.
1213f3f3 sago007 2015-09-19 19:24 250
	 * @note Windows: This version is XP compatible and returns the Desktop. Vista and later has a dedicated folder.
1213f3f3 sago007 2015-09-19 19:24 251
	 * @return Absolute path to the folder where files are downloaded to.
1213f3f3 sago007 2015-09-19 19:24 252
	 */
1213f3f3 sago007 2015-09-19 19:24 253
	std::string getDownloadFolder1() const;
1213f3f3 sago007 2015-09-19 19:24 254
	/**
1213f3f3 sago007 2015-09-19 19:24 255
	 * The folder where music is stored
1213f3f3 sago007 2015-09-19 19:24 256
	 * @return Absolute path to the music folder
1213f3f3 sago007 2015-09-19 19:24 257
	 */
1213f3f3 sago007 2015-09-19 19:24 258
	std::string getMusicFolder() const;
1213f3f3 sago007 2015-09-19 19:24 259
	/**
1213f3f3 sago007 2015-09-19 19:24 260
	 * The folder where video is stored
1213f3f3 sago007 2015-09-19 19:24 261
	 * @return Absolute path to the video folder
1213f3f3 sago007 2015-09-19 19:24 262
	 */
1213f3f3 sago007 2015-09-19 19:24 263
	std::string getVideoFolder() const;
1213f3f3 sago007 2015-09-19 19:24 264
	/**
6b50949e sago007 2018-06-24 14:45 265
	 * The base folder for storing saved games.
1213f3f3 sago007 2015-09-19 19:24 266
	 * You must add the program name to it like this:
1213f3f3 sago007 2015-09-19 19:24 267
	 * @code{.cpp}
1213f3f3 sago007 2015-09-19 19:24 268
	 * PlatformFolders pf;
1213f3f3 sago007 2015-09-19 19:24 269
	 * string saved_games_folder = pf.getSaveGamesFolder1()+"/My Program Name/";
1213f3f3 sago007 2015-09-19 19:24 270
	 * @endcode
1213f3f3 sago007 2015-09-19 19:24 271
	 * @note Windows: This is an XP compatible version and returns the path to "My Games" in Documents. Vista and later has an official folder.
84975644 Poul Sander 2025-12-10 16:34 272
	 * @note Linux: XDG does not define a folder for saved games. This will just return the same as getDataHome()
84975644 Poul Sander 2025-12-10 16:34 273
	 * @return The base folder for storing save games.
1213f3f3 sago007 2015-09-19 19:24 274
	 */
1213f3f3 sago007 2015-09-19 19:24 275
	std::string getSaveGamesFolder1() const;
1213f3f3 sago007 2015-09-19 19:24 276
private:
42748e0d Poul Sander 2025-04-22 18:11 277
	PlatformFolders(const PlatformFolders&) = delete;
42748e0d Poul Sander 2025-04-22 18:11 278
	PlatformFolders& operator=(const PlatformFolders&) = delete;
b3e5a881 sum01 2018-04-21 22:53 279
#if !defined(_WIN32) && !defined(__APPLE__)
1213f3f3 sago007 2015-09-19 19:24 280
	struct PlatformFoldersData;
0fd23ef9 sago007 2018-05-22 17:49 281
	PlatformFoldersData* data;
1ff6644e sago007 2018-02-18 16:28 282
#endif
1213f3f3 sago007 2015-09-19 19:24 283
};
1213f3f3 sago007 2015-09-19 19:24 284
0fd23ef9 sago007 2018-05-22 17:49 285
#endif // skip doxygen
0fd23ef9 sago007 2018-05-22 17:49 286
0fd23ef9 sago007 2018-05-22 17:49 287
1213f3f3 sago007 2015-09-19 19:24 288
}  //namespace sago
1213f3f3 sago007 2015-09-19 19:24 289
d2b67cec sago007 2018-03-24 09:52 290
#endif  /* PLATFORM_FOLDERS_H */
1970-01-01 00:00 291