-
Notifications
You must be signed in to change notification settings - Fork 93
/
pathmanager.h
96 lines (84 loc) · 3.93 KB
/
pathmanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/************************************************************************/
/* */
/* This file is part of VDrift. */
/* */
/* VDrift is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* VDrift is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with VDrift. If not, see <http://www.gnu.org/licenses/>. */
/* */
/************************************************************************/
#ifndef _PATHMANAGER_H
#define _PATHMANAGER_H
#include <list>
#include <iosfwd>
#include <string>
class PathManager
{
public:
void Init(std::ostream & info_output, std::ostream & error_output);
/// Only call this before Init().
void SetProfile(const std::string & value);
/// Optionally filter for the given extension.
bool GetFileList(std::string folderpath, std::list <std::string> & outputfolderlist, std::string extension="") const;
bool FileExists(const std::string & filename) const;
static void CopyFileTo(const std::string & oldname, const std::string & newname);
static void MakeDir(const std::string & dir);
static void RemoveDir(const std::string & dir);
static void RemoveFile(const std::string & path);
std::string GetDataPath() const;
std::string GetWriteableDataPath() const;
std::string GetCarPartsPath() const;
std::string GetTrackPartsPath() const;
std::string GetStartupFile() const;
std::string GetTrackRecordsPath() const;
std::string GetSettingsFile() const;
std::string GetLogFile() const;
std::string GetTracksPath(const std::string & carname) const;
std::string GetCarPath(const std::string & carname) const;
std::string GetCarPaintPath(const std::string & carname) const;
std::string GetGUIMenuPath(const std::string & skinname) const;
std::string GetSkinsPath() const;
std::string GetOptionsFile() const;
std::string GetCarControlsFile() const;
std::string GetDefaultCarControlsFile() const;
std::string GetReplayPath() const;
std::string GetScreenshotPath() const;
std::string GetStaticReflectionMap() const;
std::string GetStaticAmbientMap() const;
std::string GetShaderPath() const;
std::string GetUpdateManagerFile() const;
std::string GetUpdateManagerFileBackup() const;
std::string GetUpdateManagerFileBase() const;
std::string GetTracksDir() const;
std::string GetCarsDir() const;
std::string GetCarPartsDir() const;
std::string GetSkinsDir() const;
std::string GetGUITextureDir(const std::string & skinname) const;
std::string GetGUILanguageDir(const std::string & skinname) const;
std::string GetFontDir(const std::string & skinname) const;
std::string GetGenericSoundDir() const;
std::string GetHUDTextureDir() const;
std::string GetEffectsTextureDir() const;
std::string GetTireSmokeTextureDir() const;
std::string GetReadOnlyCarsPath() const;
std::string GetWriteableCarsPath() const;
std::string GetReadOnlyTracksPath() const;
std::string GetWriteableTracksPath() const;
std::string GetTemporaryFolder() const;
private:
std::string home_directory;
std::string settings_path;
std::string data_directory;
std::string profile_suffix;
std::string temporary_folder;
};
#endif