| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
3 |
<head> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
5 |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
6 |
<meta name="generator" content="Doxygen 1.8.17"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
10 |
<script type="text/javascript" src="jquery.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
12 |
<link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
13 |
<script type="text/javascript" src="search/searchdata.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
14 |
<script type="text/javascript" src="search/search.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
15 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
16 |
</head> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
17 |
<body> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
18 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
19 |
<div id="titlearea"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
20 |
<table cellspacing="0" cellpadding="0"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
21 |
<tbody> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
22 |
<tr style="height: 56px;"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
23 |
<td id="projectalign" style="padding-left: 0.5em;"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
24 |
<div id="projectname">Platform folders |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
25 |
 <span id="projectnumber">4.1.0</span> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
26 |
</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
27 |
</td> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
28 |
</tr> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
29 |
</tbody> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
30 |
</table> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
31 |
</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
32 |
<!-- end header part --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
33 |
<!-- Generated by Doxygen 1.8.17 --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
34 |
<script type="text/javascript"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
35 |
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
36 |
var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
37 |
/* @license-end */ |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
38 |
</script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
39 |
<script type="text/javascript" src="menudata.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
40 |
<script type="text/javascript" src="menu.js"></script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
41 |
<script type="text/javascript"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
42 |
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
43 |
$(function() { |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
44 |
initMenu('',true,false,'search.php','Search'); |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
45 |
$(document).ready(function() { init_search(); }); |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
46 |
}); |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
47 |
/* @license-end */</script> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
48 |
<div id="main-nav"></div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
49 |
</div><!-- top --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
50 |
<!-- window showing the filter options --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
51 |
<div id="MSearchSelectWindow" |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
52 |
onmouseover="return searchBox.OnSearchSelectShow()" |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
53 |
onmouseout="return searchBox.OnSearchSelectHide()" |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
54 |
onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
55 |
</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
56 |
|
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
57 |
<!-- iframe showing the search results (closed by default) --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
58 |
<div id="MSearchResultsWindow"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
59 |
<iframe src="javascript:void(0)" frameborder="0" |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
60 |
name="MSearchResults" id="MSearchResults"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
61 |
</iframe> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
62 |
</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
63 |
|
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
64 |
<div class="PageDoc"><div class="header"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
65 |
<div class="headertitle"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
66 |
<div class="title">PlatformFolders <a href="https://travis-ci.org/sago007/PlatformFolders"><object type="image/svg+xml" data="https://travis-ci.org/sago007/PlatformFolders.svg?branch=master" style="pointer-events: none;">Build Status</object></a> <a href="https://ci.appveyor.com/project/sago007/platformfolders"><object type="image/svg+xml" data="https://img.shields.io/appveyor/ci/sago007/PlatformFolders.svg?label=Windows" style="pointer-events: none;">AppVeyor</object></a> <a href="https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE"><object type="image/svg+xml" data="https://img.shields.io/github/license/sago007/PlatformFolders.svg" style="pointer-events: none;">license</object></a> <a href="https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><object type="image/svg+xml" data="https://badges.gitter.im/PlatformFolders/Lobby.svg" style="pointer-events: none;">Join the chat at https://gitter.im/PlatformFolders/Lobby</object></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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
67 |
</div><!--header--> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
68 |
<div class="contents"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
69 |
<div class="textblock"><p>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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
70 |
<p><a href="https://github.com/sago007/PlatformFolders">Source code</a> • <a href="https://github.com/sago007/PlatformFolders/releases/latest">Latest release</a> • <a href="https://sago007.github.io/PlatformFolders/html/doxygen/">Doxygen documentation</a></p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
71 |
<h1><a class="anchor" id="autotoc_md1"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
72 |
Rationale</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
76 |
<p>There are some alternatives that you might consider instead:</p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
77 |
<ul> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
78 |
<li><a href="https://doc.qt.io/qt-5/qstandardpaths.html">QStandardPaths</a></li> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
79 |
<li><a href="https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html">glib</a></li> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
80 |
</ul> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
82 |
<h1><a class="anchor" id="autotoc_md2"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
83 |
Operating System Support</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
84 |
<h2><a class="anchor" id="autotoc_md3"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
85 |
Windows</h2> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
86 |
<p>For Windows, the current version fetches the folders using SHGetKnownFolderPath. This requires Vista or newer.</p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
87 |
<h2><a class="anchor" id="autotoc_md4"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
88 |
Linux</h2> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
89 |
<p>This library uses the <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG user-dirs.</a></p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
91 |
<h2><a class="anchor" id="autotoc_md5"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
92 |
macOS</h2> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
94 |
<h1><a class="anchor" id="autotoc_md6"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
95 |
Usage</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
98 |
<div class="fragment"><div class="line"># Specifying a version is optional -- note it follows Semver</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
99 |
<div class="line">find_package(platform_folders 3.1.0 REQUIRED)</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
100 |
<div class="line"># Which imports the linkable library "sago::platform_folders"</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
101 |
<div class="line"># Use it like so...</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
102 |
<div class="line">target_link_libraries(EXEORLIBNAME PRIVATE sago::platform_folders)</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
105 |
<h2><a class="anchor" id="autotoc_md7"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
106 |
Building</h2> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
107 |
<p><b>Notes:</b></p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
108 |
<ul> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
109 |
<li>Until 4.0.0 macOS required the CoreServices framework during linking.</li> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
110 |
<li>If you don't want to install, remove the <code>--target install</code> command.</li> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
111 |
</ul> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
112 |
<p>Linux/macOS:</p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
113 |
<div class="fragment"><div class="line">mkdir -p build && cd build</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
114 |
<div class="line">cmake -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
115 |
<div class="line">sudo cmake --build . --target install</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
116 |
</div><!-- fragment --><p>Windows:</p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
117 |
<div class="fragment"><div class="line">mkdir build && cd build</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
118 |
<div class="line">cmake -DBUILD_TESTING=OFF ..</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
119 |
<div class="line">runas /user:Administrator "cmake --build . --config Release --target install"</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
120 |
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md8"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
121 |
Example Usage</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
122 |
<p>This sample program gets all folders from the system:</p> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
123 |
<div class="fragment"><div class="line"><span class="preprocessor">#include <sago/platform_folders.h></span></div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
124 |
<div class="line"><span class="preprocessor">#include <iostream></span></div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
125 |
<div class="line"><span class="preprocessor">#include <string></span></div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
126 |
<div class="line"> </div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
127 |
<div class="line"><span class="keywordtype">int</span> main()</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
128 |
<div class="line">{</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
140 |
<div class="line"> <span class="keywordflow">return</span> 0;</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
141 |
<div class="line">}</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
142 |
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md9"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
143 |
Example Output</h2> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
144 |
<h3><a class="anchor" id="autotoc_md10"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
145 |
On Linux</h3> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
146 |
<div class="fragment"><div class="line">Config: /home/poul/.config</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
147 |
<div class="line">Data: /home/poul/.local/share</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
148 |
<div class="line">Cache: /home/poul/.cache</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
149 |
<div class="line">Documents: /home/poul/Dokumenter</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
150 |
<div class="line">Desktop: /home/poul/Skrivebord</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
151 |
<div class="line">Pictures: /home/poul/Billeder</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
152 |
<div class="line">Music: /home/poul/Musik</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
153 |
<div class="line">Video: /home/poul/Videoklip</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
154 |
<div class="line">Download: /home/poul/Hentede filer</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
155 |
<div class="line">Save Games 1: /home/poul/.local/share</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
156 |
<div class="line">Save Games 2: /home/poul/.local/share</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
157 |
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md11"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
158 |
On Windows</h3> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
159 |
<div class="fragment"><div class="line">Config: C:\users\poul\Application Data</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
160 |
<div class="line">Data: C:\users\poul\Application Data</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
161 |
<div class="line">Cache: C:\users\poul\Local Settings\Application Data</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
162 |
<div class="line">Documents: C:\users\poul\Mine dokumenter</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
163 |
<div class="line">Desktop: C:\users\poul\Skrivebord</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
164 |
<div class="line">Pictures: C:\users\poul\Mine Billeder</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
165 |
<div class="line">Music: C:\users\poul\Min Musik</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
166 |
<div class="line">Video: C:\users\poul\Mine Film</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
167 |
<div class="line">Download: C:\users\poul\Downloads</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
168 |
<div class="line">Save Games 1: C:\users\poul\Mine dokumenter\My Games</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
169 |
<div class="line">Save Games 2: C:\users\poul\Saved Games</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
170 |
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md12"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
171 |
On macOS</h3> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
172 |
<div class="fragment"><div class="line">Config: /Users/poul/Library/Application Support</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
173 |
<div class="line">Data: /Users/poul/Library/Application Support</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
174 |
<div class="line">Cache: /Users/poul/Library/Caches</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
175 |
<div class="line">Documents: /Users/poul/Documents</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
176 |
<div class="line">Desktop: /Users/poul/Desktop</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
177 |
<div class="line">Pictures: /Users/poul/Pictures</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
178 |
<div class="line">Music: /Users/poul/Music</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
179 |
<div class="line">Video: /Users/poul/Movies</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
180 |
<div class="line">Download: /Users/poul/Downloads</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
181 |
<div class="line">Save Games 1: /Users/poul/Library/Application Support</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
182 |
<div class="line">Save Games 2: /Users/poul/Library/Application Support</div> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
183 |
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md13"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
184 |
Compiler Compatibility</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
185 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
186 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
187 |
<h1><a class="anchor" id="autotoc_md14"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
188 |
Encoding</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
189 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
190 |
<h1><a class="anchor" id="autotoc_md15"></a> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
191 |
Licence</h1> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
192 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
193 |
</div></div><!-- PageDoc --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
194 |
</div><!-- contents --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
195 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
196 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
197 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
198 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
199 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
200 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
201 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
202 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
203 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
204 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
205 |
<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> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
206 |
<!-- start footer part --> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
207 |
<hr class="footer"/><address class="footer"><small> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
208 |
Generated on Sun Aug 8 2021 17:40:43 for Platform folders by  <a href="http://www.doxygen.org/index.html"> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
209 |
<img class="footer" src="doxygen.png" alt="doxygen"/> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
210 |
</a> 1.8.17 |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
211 |
</small></address> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
212 |
</body> |
| 9e6bb466 |
Poul Sander |
2021-08-08 15:42 |
213 |
</html> |
|
|
1970-01-01 00:00 |
214 |
|