git repos / blockattack-game

blame: source/code/os.hpp

normal view · raw

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