Platform folders  4.1.0
platform_folders.h
1 /*
2 Its is under the MIT license, to encourage reuse by cut-and-paste.
3 
4 The original files are hosted here: https://github.com/sago007/PlatformFolders
5 
6 Copyright (c) 2015 Poul Sander
7 
8 Permission is hereby granted, free of charge, to any person
9 obtaining a copy of this software and associated documentation files
10 (the "Software"), to deal in the Software without restriction,
11 including without limitation the rights to use, copy, modify, merge,
12 publish, distribute, sublicense, and/or sell copies of the Software,
13 and to permit persons to whom the Software is furnished to do so,
14 subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be
17 included in all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 SOFTWARE.
27 */
28 
29 #ifndef SAGO_PLATFORM_FOLDERS_H
30 #define SAGO_PLATFORM_FOLDERS_H
31 
32 #include <vector>
33 #include <string>
34 
38 namespace sago {
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 namespace internal {
42 #if !defined(_WIN32) && !defined(__APPLE__)
43 void appendExtraFoldersTokenizer(const char* envName, const char* envValue, std::vector<std::string>& folders);
44 #endif
45 #ifdef _WIN32
46 std::string win32_utf16_to_utf8(const wchar_t* wstr);
47 #endif
48 }
49 #endif //DOXYGEN_SHOULD_SKIP_THIS
50 
61 std::string getDataHome();
62 
73 std::string getConfigHome();
74 
85 std::string getCacheDir();
86 
103 void appendAdditionalDataDirectories(std::vector<std::string>& homes);
104 
121 void appendAdditionalConfigDirectories(std::vector<std::string>& homes);
122 
128 std::string getDesktopFolder();
129 
134 std::string getDocumentsFolder();
135 
140 std::string getDownloadFolder();
141 
147 std::string getDownloadFolder1();
148 
153 std::string getPicturesFolder();
154 
159 std::string getPublicFolder();
160 
165 std::string getMusicFolder();
166 
171 std::string getVideoFolder();
172 
183 std::string getSaveGamesFolder1();
184 
197 std::string getSaveGamesFolder2();
198 
199 #ifndef DOXYGEN_SHOULD_SKIP_THIS
200 
207 class PlatformFolders {
208 public:
209  PlatformFolders();
210  ~PlatformFolders();
216  std::string getDesktopFolder() const;
221  std::string getDocumentsFolder() const;
226  std::string getPicturesFolder() const;
230  std::string getPublicFolder() const;
236  std::string getDownloadFolder1() const;
241  std::string getMusicFolder() const;
246  std::string getVideoFolder() const;
258  std::string getSaveGamesFolder1() const;
259 private:
260  PlatformFolders(const PlatformFolders&);
261  PlatformFolders& operator=(const PlatformFolders&);
262 #if !defined(_WIN32) && !defined(__APPLE__)
263  struct PlatformFoldersData;
264  PlatformFoldersData* data;
265 #endif
266 };
267 
268 #endif // skip doxygen
269 
270 
271 } //namespace sago
272 
273 #endif /* PLATFORM_FOLDERS_H */
sago
Definition: platform_folders.h:38
sago::getSaveGamesFolder1
std::string getSaveGamesFolder1()
sago::getDataHome
std::string getDataHome()
sago::getPicturesFolder
std::string getPicturesFolder()
sago::getVideoFolder
std::string getVideoFolder()
sago::getCacheDir
std::string getCacheDir()
sago::getPublicFolder
std::string getPublicFolder()
sago::getSaveGamesFolder2
std::string getSaveGamesFolder2()
sago::appendAdditionalDataDirectories
void appendAdditionalDataDirectories(std::vector< std::string > &homes)
sago::getDownloadFolder
std::string getDownloadFolder()
sago::getDesktopFolder
std::string getDesktopFolder()
sago::getDocumentsFolder
std::string getDocumentsFolder()
sago::getMusicFolder
std::string getMusicFolder()
sago::getDownloadFolder1
std::string getDownloadFolder1()
sago::getConfigHome
std::string getConfigHome()
sago::appendAdditionalConfigDirectories
void appendAdditionalConfigDirectories(std::vector< std::string > &homes)