Platform folders 4.2.0
Loading...
Searching...
No Matches
platform_folders.h
1/*
2Its is under the MIT license, to encourage reuse by cut-and-paste.
3
4The original files are hosted here: https://github.com/sago007/PlatformFolders
5
6Copyright (c) 2015 Poul Sander
7
8Permission is hereby granted, free of charge, to any person
9obtaining a copy of this software and associated documentation files
10(the "Software"), to deal in the Software without restriction,
11including without limitation the rights to use, copy, modify, merge,
12publish, distribute, sublicense, and/or sell copies of the Software,
13and to permit persons to whom the Software is furnished to do so,
14subject to the following conditions:
15
16The above copyright notice and this permission notice shall be
17included in all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26SOFTWARE.
27*/
28
29#ifndef SAGO_PLATFORM_FOLDERS_H
30#define SAGO_PLATFORM_FOLDERS_H
31
32#include <vector>
33#include <string>
34
38namespace sago {
39
40#ifndef DOXYGEN_SHOULD_SKIP_THIS
41namespace internal {
42#if !defined(_WIN32) && !defined(__APPLE__)
43void appendExtraFoldersTokenizer(const char* envName, const char* envValue, std::vector<std::string>& folders);
44#endif
45#ifdef _WIN32
46std::string win32_utf16_to_utf8(const wchar_t* wstr);
47#endif
48}
49#endif //DOXYGEN_SHOULD_SKIP_THIS
50
61std::string getDataHome();
62
73std::string getConfigHome();
74
86std::string getCacheDir();
87
99std::string getStateDir();
100
117void appendAdditionalDataDirectories(std::vector<std::string>& homes);
118
135void appendAdditionalConfigDirectories(std::vector<std::string>& homes);
136
142std::string getDesktopFolder();
143
148std::string getDocumentsFolder();
149
154std::string getDownloadFolder();
155
161std::string getDownloadFolder1();
162
167std::string getPicturesFolder();
168
173std::string getPublicFolder();
174
179std::string getMusicFolder();
180
185std::string getVideoFolder();
186
198
212
213#ifndef DOXYGEN_SHOULD_SKIP_THIS
214
221class PlatformFolders {
222public:
223 PlatformFolders();
224 ~PlatformFolders();
230 std::string getDesktopFolder() const;
235 std::string getDocumentsFolder() const;
240 std::string getPicturesFolder() const;
244 std::string getPublicFolder() const;
250 std::string getDownloadFolder1() const;
255 std::string getMusicFolder() const;
260 std::string getVideoFolder() const;
272 std::string getSaveGamesFolder1() const;
273private:
274 PlatformFolders(const PlatformFolders&);
275 PlatformFolders& operator=(const PlatformFolders&);
276#if !defined(_WIN32) && !defined(__APPLE__)
277 struct PlatformFoldersData;
278 PlatformFoldersData* data;
279#endif
280};
281
282#endif // skip doxygen
283
284
285} //namespace sago
286
287#endif /* PLATFORM_FOLDERS_H */
Definition platform_folders.h:38
void appendAdditionalDataDirectories(std::vector< std::string > &homes)
std::string getCacheDir()
std::string getPicturesFolder()
std::string getPublicFolder()
std::string getDownloadFolder()
void appendAdditionalConfigDirectories(std::vector< std::string > &homes)
std::string getDownloadFolder1()
std::string getDataHome()
std::string getVideoFolder()
std::string getStateDir()
std::string getDocumentsFolder()
std::string getConfigHome()
std::string getSaveGamesFolder1()
std::string getDesktopFolder()
std::string getMusicFolder()
std::string getSaveGamesFolder2()