git repos / PlatformFolders

blame: platform_folders.cpp

normal view · raw

1213f3f3 sago007 2015-09-19 19:24 1
/*
1213f3f3 sago007 2015-09-19 19:24 2
  Its is under the MIT license, to encourage reuse by cut-and-paste.
1213f3f3 sago007 2015-09-19 19:24 3
1213f3f3 sago007 2015-09-19 19:24 4
  Copyright (c) 2015 Poul Sander
1213f3f3 sago007 2015-09-19 19:24 5
1213f3f3 sago007 2015-09-19 19:24 6
  Permission is hereby granted, free of charge, to any person
1213f3f3 sago007 2015-09-19 19:24 7
  obtaining a copy of this software and associated documentation files
1213f3f3 sago007 2015-09-19 19:24 8
  (the "Software"), to deal in the Software without restriction,
1213f3f3 sago007 2015-09-19 19:24 9
  including without limitation the rights to use, copy, modify, merge,
1213f3f3 sago007 2015-09-19 19:24 10
  publish, distribute, sublicense, and/or sell copies of the Software,
1213f3f3 sago007 2015-09-19 19:24 11
  and to permit persons to whom the Software is furnished to do so,
1213f3f3 sago007 2015-09-19 19:24 12
  subject to the following conditions:
1213f3f3 sago007 2015-09-19 19:24 13
1213f3f3 sago007 2015-09-19 19:24 14
  The above copyright notice and this permission notice shall be
1213f3f3 sago007 2015-09-19 19:24 15
  included in all copies or substantial portions of the Software.
1213f3f3 sago007 2015-09-19 19:24 16
1213f3f3 sago007 2015-09-19 19:24 17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1213f3f3 sago007 2015-09-19 19:24 18
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1213f3f3 sago007 2015-09-19 19:24 19
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1213f3f3 sago007 2015-09-19 19:24 20
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1213f3f3 sago007 2015-09-19 19:24 21
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1213f3f3 sago007 2015-09-19 19:24 22
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1213f3f3 sago007 2015-09-19 19:24 23
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1213f3f3 sago007 2015-09-19 19:24 24
  SOFTWARE.
1213f3f3 sago007 2015-09-19 19:24 25
*/
1213f3f3 sago007 2015-09-19 19:24 26
1213f3f3 sago007 2015-09-19 19:24 27
#include <iostream>
1213f3f3 sago007 2015-09-19 19:24 28
#include "sago/platform_folders.h"
1213f3f3 sago007 2015-09-19 19:24 29
0fd23ef9 sago007 2018-05-22 17:49 30
int main() {
9ad3df57 Poul Sander 2016-09-02 20:14 31
	std::cout << "Config: " << sago::getConfigHome() << "\n";
9ad3df57 Poul Sander 2016-09-02 20:14 32
	std::cout << "Data: " << sago::getDataHome() << "\n";
9ad3df57 Poul Sander 2016-09-02 20:14 33
	std::cout << "Cache: " << sago::getCacheDir() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 34
	std::cout << "Documents: " << sago::getDocumentsFolder() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 35
	std::cout << "Desktop: " << sago::getDesktopFolder() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 36
	std::cout << "Pictures: " << sago::getPicturesFolder() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 37
	std::cout << "Music: " << sago::getMusicFolder() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 38
	std::cout << "Video: " << sago::getVideoFolder() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 39
	std::cout << "Download: " << sago::getDownloadFolder1() << "\n";
0fd23ef9 sago007 2018-05-22 17:49 40
	std::cout << "Save Games 1: " << sago::getSaveGamesFolder1() << "\n";
9ad3df57 Poul Sander 2016-09-02 20:14 41
	std::vector<std::string> extraData;
9ad3df57 Poul Sander 2016-09-02 20:14 42
	sago::appendAdditionalDataDirectories(extraData);
9ad3df57 Poul Sander 2016-09-02 20:14 43
	for (size_t i=0; i < extraData.size(); ++i) {
9ad3df57 Poul Sander 2016-09-02 20:14 44
		std::cout << "Additional data " << i << ": " << extraData.at(i) << "\n";
9ad3df57 Poul Sander 2016-09-02 20:14 45
	}
1213f3f3 sago007 2015-09-19 19:24 46
	return 0;
1213f3f3 sago007 2015-09-19 19:24 47
}
1970-01-01 00:00 48