| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
3 |
<head> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
5 |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
6 |
<meta name="generator" content="Doxygen 1.9.1"/> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
8 |
<title>Platform folders: PlatformFolders <a href="https://travis-ci.org/sago007/PlatformFolders"><img src="https://travis-ci.org/sago007/PlatformFolders.svg?branch=master" alt="Build Status"/></a> <a href="https://ci.appveyor.com/project/sago007/platformfolders"><img src="https://img.shields.io/appveyor/ci/sago007/PlatformFolders.svg?label=Windows" alt="AppVeyor"/></a> <a href="https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE"><img src="https://img.shields.io/github/license/sago007/PlatformFolders.svg" alt="license"/></a> <a href="https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/PlatformFolders/Lobby.svg" alt="Join the chat at https://gitter.im/PlatformFolders/Lobby"/></a> <a href="https://www.codacy.com/app/github_43/PlatformFolders?utm_source=github.com&utm_medium=referral&utm_content=sago007/PlatformFolders&utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/729e36adcf5c4523bd136de1b33441cb" alt="Codacy Badge"/></a></title> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
10 |
<script type="text/javascript" src="jquery.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
12 |
<link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
13 |
<script type="text/javascript" src="search/searchdata.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
14 |
<script type="text/javascript" src="search/search.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
15 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
16 |
</head> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
17 |
<body> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
18 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
19 |
<div id="titlearea"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
20 |
<table cellspacing="0" cellpadding="0"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
21 |
<tbody> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
22 |
<tr style="height: 56px;"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
23 |
<td id="projectalign" style="padding-left: 0.5em;"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
24 |
<div id="projectname">Platform folders |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
25 |
 <span id="projectnumber">4.0.0</span> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
26 |
</div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
27 |
</td> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
28 |
</tr> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
29 |
</tbody> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
30 |
</table> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
31 |
</div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
32 |
<!-- end header part --> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
33 |
<!-- Generated by Doxygen 1.9.1 --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
34 |
<script type="text/javascript"> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
35 |
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
36 |
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
37 |
/* @license-end */ |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
38 |
</script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
39 |
<script type="text/javascript" src="menudata.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
40 |
<script type="text/javascript" src="menu.js"></script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
41 |
<script type="text/javascript"> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
42 |
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
43 |
$(function() { |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
44 |
initMenu('',true,false,'search.php','Search'); |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
45 |
$(document).ready(function() { init_search(); }); |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
46 |
}); |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
47 |
/* @license-end */</script> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
48 |
<div id="main-nav"></div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
49 |
</div><!-- top --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
50 |
<!-- window showing the filter options --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
51 |
<div id="MSearchSelectWindow" |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
52 |
onmouseover="return searchBox.OnSearchSelectShow()" |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
53 |
onmouseout="return searchBox.OnSearchSelectHide()" |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
54 |
onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
55 |
</div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
56 |
|
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
57 |
<!-- iframe showing the search results (closed by default) --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
58 |
<div id="MSearchResultsWindow"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
59 |
<iframe src="javascript:void(0)" frameborder="0" |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
60 |
name="MSearchResults" id="MSearchResults"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
61 |
</iframe> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
62 |
</div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
63 |
|
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
64 |
<div class="PageDoc"><div class="header"> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
65 |
<div class="headertitle"> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
66 |
<div class="title">PlatformFolders <a href="https://travis-ci.org/sago007/PlatformFolders"><img src="https://travis-ci.org/sago007/PlatformFolders.svg?branch=master" alt="Build Status" style="pointer-events: none;" class="inline"/></a> <a href="https://ci.appveyor.com/project/sago007/platformfolders"><img src="https://img.shields.io/appveyor/ci/sago007/PlatformFolders.svg?label=Windows" alt="AppVeyor" style="pointer-events: none;" class="inline"/></a> <a href="https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE"><img src="https://img.shields.io/github/license/sago007/PlatformFolders.svg" alt="license" style="pointer-events: none;" class="inline"/></a> <a href="https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/PlatformFolders/Lobby.svg" alt="Join the chat at https://gitter.im/PlatformFolders/Lobby" style="pointer-events: none;" class="inline"/></a> <a href="https://www.codacy.com/app/github_43/PlatformFolders?utm_source=github.com&utm_medium=referral&utm_content=sago007/PlatformFolders&utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/729e36adcf5c4523bd136de1b33441cb" alt="Codacy Badge" class="inline"/></a> </div> </div> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
67 |
</div><!--header--> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
68 |
<div class="contents"> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
69 |
<div class="textblock"><p><a class="anchor" id="md_README"></a> A C++ library to look for directories like <code>My Documents</code>, <code>~/.config</code>, <code>APPDATA%</code>, etc. so that you do not need to write platform-specific code</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
70 |
<p><a href="https://github.com/sago007/PlatformFolders">Source code</a> • <a href="https://github.com/sago007/PlatformFolders/releases/tag/4.0.0">Latest release (4.0.0)</a> • <a href="https://sago007.github.io/PlatformFolders/html/doxygen/">Doxygen documentation</a></p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
71 |
<h1><a class="anchor" id="autotoc_md1"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
72 |
Rationale</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
73 |
<p>There are a lot of platform abstraction libraries available. You can get graphics abstraction libraries, GUI abstraction libraries and file abstraction libraries.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
74 |
<p>But folder abstraction seems to be more difficult. My problem was that the code that found the place to save data was platform dependent. This cluttered my code and often I would not discover that it did not compile until moving it to the different platforms.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
75 |
<p><a href="https://sago007.blogspot.dk/2015/10/abstraction-for-special-folders.html">I have written a bit more about it here.</a></p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
76 |
<p>There are some alternatives that you might consider instead:</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
77 |
<ul> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
78 |
<li><a href="https://doc.qt.io/qt-5/qstandardpaths.html">QStandardPaths</a></li> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
79 |
<li><a href="https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html">glib</a></li> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
80 |
</ul> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
81 |
<p>Both are properly more mature than this library. However they are both parts of large frameworks and using them with libraries outside the framework may not be that simple.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
82 |
<h1><a class="anchor" id="autotoc_md2"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
83 |
Operating System Support</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
84 |
<h2><a class="anchor" id="autotoc_md3"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
85 |
Windows</h2> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
86 |
<p>For Windows, the current version fetches the folders using SHGetKnownFolderPath. This requires Vista or newer.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
87 |
<h2><a class="anchor" id="autotoc_md4"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
88 |
Linux</h2> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
89 |
<p>This library uses the <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG user-dirs.</a></p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
90 |
<p>It should work on any Unix system that has the following headers available: <code>pwd.h</code>, <code>unistd.h</code>, and <code>sys/types.h</code></p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
91 |
<h2><a class="anchor" id="autotoc_md5"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
92 |
macOS</h2> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
93 |
<p>Version 4.0.0 and forward uses hardcoded values for the directories on Mac OS X. Unlike the other operating systems the folders cannot be moved on a Mac and the translation is done in the UI. The versions 2.X and 3.X uses the deprecated FSFindFolder, which requires the CoreServices framework during linking. Version 1.X simple used the XDG specification.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
94 |
<h1><a class="anchor" id="autotoc_md6"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
95 |
Usage</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
96 |
<p>This project should be compatible with things like <a href="https://cmake.org/cmake/help/latest/module/ExternalProject.html?highlight=externalproject_add#command:externalproject_add">Cmake's ExternalProject_Add</a> if you wish to use it in your project.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
97 |
<p>You can also follow the <a href="#building">build step</a> below to install at a system level, and use <a href="https://cmake.org/cmake/help/latest/command/find_package.html">Cmake's find_package</a>.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
98 |
<div class="fragment"><div class="line"># Specifying a version is optional -- note it follows Semver</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
99 |
<div class="line">find_package(platform_folders 3.1.0 REQUIRED)</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
100 |
<div class="line"># Which imports the linkable library "sago::platform_folders"</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
101 |
<div class="line"># Use it like so...</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
102 |
<div class="line">target_link_libraries(EXEORLIBNAME PRIVATE sago::platform_folders)</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
103 |
</div><!-- fragment --><p>Alternatively, you can just copy the <a href="https://github.com/sago007/PlatformFolders/tree/master/sago">sago</a> folder into your program and manually link everything. If you use the last option and are using a library version from before 4.0.0: Remember to link to the CoreServices lib when compiling on Mac. This typically means passing "-framework CoreServices" during the linking phase.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
104 |
<p>Note that if you build in-tree, you can link against the Cmake alias <code>sago::platform_folders</code> just like if you had used find_package.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
105 |
<h2><a class="anchor" id="autotoc_md7"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
106 |
Building</h2> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
107 |
<p><b>Notes:</b></p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
108 |
<ul> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
109 |
<li>Until 4.0.0 macOS required the CoreServices framework during linking.</li> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
110 |
<li>If you don't want to install, remove the <code>--target install</code> command.</li> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
111 |
</ul> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
112 |
<p>Linux/macOS:</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
113 |
<div class="fragment"><div class="line">mkdir -p build && cd build</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
114 |
<div class="line">cmake -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
115 |
<div class="line">sudo cmake --build . --target install</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
116 |
</div><!-- fragment --><p>Windows:</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
117 |
<div class="fragment"><div class="line">mkdir build && cd build</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
118 |
<div class="line">cmake -DBUILD_TESTING=OFF ..</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
119 |
<div class="line">runas /user:Administrator "cmake --build . --config Release --target install"</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
120 |
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md8"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
121 |
Example Usage</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
122 |
<p>This sample program gets all folders from the system:</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
123 |
<div class="fragment"><div class="line"><span class="preprocessor">#include <sago/platform_folders.h></span></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
124 |
<div class="line"><span class="preprocessor">#include <iostream></span></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
125 |
<div class="line"><span class="preprocessor">#include <string></span></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
126 |
<div class="line"> </div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
127 |
<div class="line"><span class="keywordtype">int</span> main()</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
128 |
<div class="line">{</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
129 |
<div class="line"> std::cout << <span class="stringliteral">"Config: "</span> << <a class="code" href="namespacesago.html#aa6c6da4e6fe460076ac069e176622f59">sago::getConfigHome</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
130 |
<div class="line"> std::cout << <span class="stringliteral">"Data: "</span> << <a class="code" href="namespacesago.html#a85c382a039426b76aa408961ac2149ee">sago::getDataHome</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
131 |
<div class="line"> std::cout << <span class="stringliteral">"Cache: "</span> << <a class="code" href="namespacesago.html#a426458c0e30383f23ecab17bdf55a407">sago::getCacheDir</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
132 |
<div class="line"> std::cout << <span class="stringliteral">"Documents: "</span> << <a class="code" href="namespacesago.html#aa44dc2057a9acdb38a10e41a60b7bb82">sago::getDocumentsFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
133 |
<div class="line"> std::cout << <span class="stringliteral">"Desktop: "</span> << <a class="code" href="namespacesago.html#ac9fc8e0a8f97b7066548223d43720ce8">sago::getDesktopFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
134 |
<div class="line"> std::cout << <span class="stringliteral">"Pictures: "</span> << <a class="code" href="namespacesago.html#a45b407f0581bf3ac349682eb2481c630">sago::getPicturesFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
135 |
<div class="line"> std::cout << <span class="stringliteral">"Music: "</span> << <a class="code" href="namespacesago.html#aef0ecc52b536a96e2f3096b43acbfcbe">sago::getMusicFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
136 |
<div class="line"> std::cout << <span class="stringliteral">"Video: "</span> << <a class="code" href="namespacesago.html#a8eda16d34cba4c0f82a6e80077660780">sago::getVideoFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
137 |
<div class="line"> std::cout << <span class="stringliteral">"Download: "</span> << <a class="code" href="namespacesago.html#a650b888f2d54cadfbe3347f3c9c40059">sago::getDownloadFolder</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
138 |
<div class="line"> std::cout << <span class="stringliteral">"Save Games 1: "</span> << <a class="code" href="namespacesago.html#ab568df2aa5ea8492975bbefb206a6145">sago::getSaveGamesFolder1</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
139 |
<div class="line"> std::cout << <span class="stringliteral">"Save Games 2: "</span> << <a class="code" href="namespacesago.html#afc7986187926c19b217427a73bdae16e">sago::getSaveGamesFolder2</a>() << <span class="stringliteral">"\n"</span>;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
140 |
<div class="line"> <span class="keywordflow">return</span> 0;</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
141 |
<div class="line">}</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
142 |
<div class="ttc" id="anamespacesago_html_a426458c0e30383f23ecab17bdf55a407"><div class="ttname"><a href="namespacesago.html#a426458c0e30383f23ecab17bdf55a407">sago::getCacheDir</a></div><div class="ttdeci">std::string getCacheDir()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
143 |
<div class="ttc" id="anamespacesago_html_a45b407f0581bf3ac349682eb2481c630"><div class="ttname"><a href="namespacesago.html#a45b407f0581bf3ac349682eb2481c630">sago::getPicturesFolder</a></div><div class="ttdeci">std::string getPicturesFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
144 |
<div class="ttc" id="anamespacesago_html_a650b888f2d54cadfbe3347f3c9c40059"><div class="ttname"><a href="namespacesago.html#a650b888f2d54cadfbe3347f3c9c40059">sago::getDownloadFolder</a></div><div class="ttdeci">std::string getDownloadFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
145 |
<div class="ttc" id="anamespacesago_html_a85c382a039426b76aa408961ac2149ee"><div class="ttname"><a href="namespacesago.html#a85c382a039426b76aa408961ac2149ee">sago::getDataHome</a></div><div class="ttdeci">std::string getDataHome()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
146 |
<div class="ttc" id="anamespacesago_html_a8eda16d34cba4c0f82a6e80077660780"><div class="ttname"><a href="namespacesago.html#a8eda16d34cba4c0f82a6e80077660780">sago::getVideoFolder</a></div><div class="ttdeci">std::string getVideoFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
147 |
<div class="ttc" id="anamespacesago_html_aa44dc2057a9acdb38a10e41a60b7bb82"><div class="ttname"><a href="namespacesago.html#aa44dc2057a9acdb38a10e41a60b7bb82">sago::getDocumentsFolder</a></div><div class="ttdeci">std::string getDocumentsFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
148 |
<div class="ttc" id="anamespacesago_html_aa6c6da4e6fe460076ac069e176622f59"><div class="ttname"><a href="namespacesago.html#aa6c6da4e6fe460076ac069e176622f59">sago::getConfigHome</a></div><div class="ttdeci">std::string getConfigHome()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
149 |
<div class="ttc" id="anamespacesago_html_ab568df2aa5ea8492975bbefb206a6145"><div class="ttname"><a href="namespacesago.html#ab568df2aa5ea8492975bbefb206a6145">sago::getSaveGamesFolder1</a></div><div class="ttdeci">std::string getSaveGamesFolder1()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
150 |
<div class="ttc" id="anamespacesago_html_ac9fc8e0a8f97b7066548223d43720ce8"><div class="ttname"><a href="namespacesago.html#ac9fc8e0a8f97b7066548223d43720ce8">sago::getDesktopFolder</a></div><div class="ttdeci">std::string getDesktopFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
151 |
<div class="ttc" id="anamespacesago_html_aef0ecc52b536a96e2f3096b43acbfcbe"><div class="ttname"><a href="namespacesago.html#aef0ecc52b536a96e2f3096b43acbfcbe">sago::getMusicFolder</a></div><div class="ttdeci">std::string getMusicFolder()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
152 |
<div class="ttc" id="anamespacesago_html_afc7986187926c19b217427a73bdae16e"><div class="ttname"><a href="namespacesago.html#afc7986187926c19b217427a73bdae16e">sago::getSaveGamesFolder2</a></div><div class="ttdeci">std::string getSaveGamesFolder2()</div></div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
153 |
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md9"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
154 |
Example Output</h2> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
155 |
<h3><a class="anchor" id="autotoc_md10"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
156 |
On Linux</h3> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
157 |
<div class="fragment"><div class="line">Config: /home/poul/.config</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
158 |
<div class="line">Data: /home/poul/.local/share</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
159 |
<div class="line">Cache: /home/poul/.cache</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
160 |
<div class="line">Documents: /home/poul/Dokumenter</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
161 |
<div class="line">Desktop: /home/poul/Skrivebord</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
162 |
<div class="line">Pictures: /home/poul/Billeder</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
163 |
<div class="line">Music: /home/poul/Musik</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
164 |
<div class="line">Video: /home/poul/Videoklip</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
165 |
<div class="line">Download: /home/poul/Hentede filer</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
166 |
<div class="line">Save Games 1: /home/poul/.local/share</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
167 |
<div class="line">Save Games 2: /home/poul/.local/share</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
168 |
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md11"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
169 |
On Windows</h3> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
170 |
<div class="fragment"><div class="line">Config: C:\users\poul\Application Data</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
171 |
<div class="line">Data: C:\users\poul\Application Data</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
172 |
<div class="line">Cache: C:\users\poul\Local Settings\Application Data</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
173 |
<div class="line">Documents: C:\users\poul\Mine dokumenter</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
174 |
<div class="line">Desktop: C:\users\poul\Skrivebord</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
175 |
<div class="line">Pictures: C:\users\poul\Mine Billeder</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
176 |
<div class="line">Music: C:\users\poul\Min Musik</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
177 |
<div class="line">Video: C:\users\poul\Mine Film</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
178 |
<div class="line">Download: C:\users\poul\Downloads</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
179 |
<div class="line">Save Games 1: C:\users\poul\Mine dokumenter\My Games</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
180 |
<div class="line">Save Games 2: C:\users\poul\Saved Games</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
181 |
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md12"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
182 |
On macOS</h3> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
183 |
<div class="fragment"><div class="line">Config: /Users/poul/Library/Application Support</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
184 |
<div class="line">Data: /Users/poul/Library/Application Support</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
185 |
<div class="line">Cache: /Users/poul/Library/Caches</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
186 |
<div class="line">Documents: /Users/poul/Documents</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
187 |
<div class="line">Desktop: /Users/poul/Desktop</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
188 |
<div class="line">Pictures: /Users/poul/Pictures</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
189 |
<div class="line">Music: /Users/poul/Music</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
190 |
<div class="line">Video: /Users/poul/Movies</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
191 |
<div class="line">Download: /Users/poul/Downloads</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
192 |
<div class="line">Save Games 1: /Users/poul/Library/Application Support</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
193 |
<div class="line">Save Games 2: /Users/poul/Library/Application Support</div> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
194 |
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md13"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
195 |
Compiler Compatibility</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
196 |
<p>Versions up to 3.X.X should compile with any C++98 compiler.\ Versions from 4.0.0 and up require a C++11 compatible compiler.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
197 |
<p>The aim is to always support the default C++ compiler on the oldest supported version of Ubuntu. This is a very basic library and it is not supposed to force you to upgrade.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
198 |
<h1><a class="anchor" id="autotoc_md14"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
199 |
Encoding</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
200 |
<p>From version 3.0, Windows always encodes to UTF-8, and this will be the default on almost any other system. Before version 3.0, Windows was encoded in ANSI. Although the user may use any characters they want, I recommend that the program should have only ASCII characters in the source code itself.</p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
201 |
<h1><a class="anchor" id="autotoc_md15"></a> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
202 |
Licence</h1> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
203 |
<p>Provided under the MIT license for the same reason XDG is licensed under it. So that you can quickly copy-paste the methods you need or just include the "sago"-folder. </p> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
204 |
</div></div><!-- PageDoc --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
205 |
</div><!-- contents --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
206 |
<!-- start footer part --> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
207 |
<hr class="footer"/><address class="footer"><small> |
| 3af4e794 |
Poul Sander |
2021-07-07 21:02 |
208 |
Generated on Wed Jul 7 2021 22:57:38 for Platform folders by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
209 |
</small></address> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
210 |
</body> |
| 7e54d64b |
sago007 |
2018-06-24 15:21 |
211 |
</html> |
|
|
1970-01-01 00:00 |
212 |
|