Debian Codegraph @

source/code/os.hpp

raw
1 /*
2 ===========================================================================
3 blockattack - Block Attack - Rise of the Blocks
4 Copyright (C) 2005-2015 Poul Sander
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see http://www.gnu.org/licenses/
18
19 Source information and contacts persons can be found at
20 https://blockattack.net
21 ===========================================================================
22 */
23
24 #ifndef OS_HPP
25 #define OS_HPP
26
27 #if defined(_WIN32)
28 #include "windows.h"
29 #include "shlobj.h"
30 #endif
31 #include <string>
32 #include <vector>
33
34 std::string getPathToSaveFiles();
35
36 std::string getPathToStateFiles();
37
38 std::string defaultPlayerName();
39
40 void setPathToSaveFiles(const std::string& path);
41
42 void OsCreateSaveFolder();
43
44 bool OsPathIsRelative(const std::string& path);
45
46 /**
47 * Create a folder
48 * The folder path is created recursively
49 * Fails silently if failing to create the path
50 * @param path The folder to create
51 */
52 void OsCreateFolder(const std::string& path);
53
54 /**
55 * Lists the content of a directory.
56 * Ignores files starting with a dot (".")
57 *
58 * @param path The path to list
59 * @return std::vector<std::string> Files names in directory
60 */
61 std::vector<std::string> OsGetDirFileList(const std::string& path);
62
63 #endif /* OS_HPP */