#include <PathManager.h>
Definition at line 14 of file PathManager.h.
◆ createIfNotExists()
| static void PathManager::createIfNotExists |
( |
const fs::path & | path | ) |
|
|
inlinestaticprivate |
Definition at line 41 of file PathManager.h.
42 {
43 if (!fs::exists(path))
44 {
45 fs::create_directories(path);
46 std::cout << "[PathManager] Created folder: " << path << std::endl;
47 }
48 }
◆ ensureDirectories()
| static void PathManager::ensureDirectories |
( |
| ) |
|
|
inlinestatic |
Definition at line 140 of file PathManager.h.
141 {
148 }
static fs::path getMarkersPath()
static fs::path getRootDirectory()
static fs::path getConfigPath()
static fs::path getGameTablesPath()
static void createIfNotExists(const fs::path &path)
static fs::path getMapsPath()
static fs::path getNotesPath()
◆ getBoardsPath()
| static fs::path PathManager::getBoardsPath |
( |
std::string | gametable_name | ) |
|
|
inlinestatic |
◆ getCertsPath()
| static fs::path PathManager::getCertsPath |
( |
| ) |
|
|
inlinestatic |
Definition at line 129 of file PathManager.h.
130 {
132 }
static fs::path getResPath()
◆ getConfigPath()
| static fs::path PathManager::getConfigPath |
( |
| ) |
|
|
inlinestatic |
Definition at line 86 of file PathManager.h.
87 {
89 }
static fs::path getExecutableRoot()
◆ getDocumentsFolder()
| static fs::path PathManager::getDocumentsFolder |
( |
| ) |
|
|
inlinestaticprivate |
Definition at line 17 of file PathManager.h.
18 {
19#ifdef _WIN32
20
21
22
23
24
25
26
27
28
29
30 const char* userProfile = std::getenv("USERPROFILE");
31 return fs::path(userProfile ? userProfile : "C:\\Users\\Default") / "Documents";
32#elif __APPLE__
33 const char* home = std::getenv("HOME");
34 return fs::path(home ? home : "/Users/Default") / "Documents";
35#else
36 const char* home = std::getenv("HOME");
37 return fs::path(home ? home : "/home/default") / "Documents";
38#endif
39 }
◆ getExecutableDirectory()
| static fs::path PathManager::getExecutableDirectory |
( |
| ) |
|
|
inlinestatic |
Definition at line 114 of file PathManager.h.
115 {
117 }
static fs::path executableDir
◆ getExecutableRoot()
| static fs::path PathManager::getExecutableRoot |
( |
| ) |
|
|
inlinestatic |
◆ getExternalPath()
| static fs::path PathManager::getExternalPath |
( |
| ) |
|
|
inlinestatic |
◆ getGameTablesPath()
| static fs::path PathManager::getGameTablesPath |
( |
| ) |
|
|
inlinestatic |
◆ getLocalTunnelClientPath()
| static fs::path PathManager::getLocalTunnelClientPath |
( |
| ) |
|
|
inlinestatic |
Definition at line 101 of file PathManager.h.
102 {
103 return getExternalPath() /
"localtunnel" /
"node_modules" /
"localtunnel" /
"bin" /
"client";
104 }
static fs::path getExternalPath()
◆ getLocalTunnelControllerPath()
| static fs::path PathManager::getLocalTunnelControllerPath |
( |
| ) |
|
|
inlinestatic |
◆ getMapsPath()
| static fs::path PathManager::getMapsPath |
( |
| ) |
|
|
inlinestatic |
◆ getMarkersPath()
| static fs::path PathManager::getMarkersPath |
( |
| ) |
|
|
inlinestatic |
◆ getNodeExePath()
| static fs::path PathManager::getNodeExePath |
( |
| ) |
|
|
inlinestatic |
◆ getNotesPath()
| static fs::path PathManager::getNotesPath |
( |
| ) |
|
|
inlinestatic |
◆ getResPath()
| static fs::path PathManager::getResPath |
( |
| ) |
|
|
inlinestatic |
◆ getRootDirectory()
| static fs::path PathManager::getRootDirectory |
( |
| ) |
|
|
inlinestatic |
◆ getShaderPath()
| static fs::path PathManager::getShaderPath |
( |
| ) |
|
|
inlinestatic |
◆ getUpnpcExePath()
| static fs::path PathManager::getUpnpcExePath |
( |
| ) |
|
|
inlinestatic |
◆ hasDirSep()
| static bool PathManager::hasDirSep |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 151 of file PathManager.h.
152 {
153 return s.find('\\') != std::string::npos || s.find('/') != std::string::npos;
154 }
◆ isAbsolutePath()
| static bool PathManager::isAbsolutePath |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 174 of file PathManager.h.
175 {
176
177 std::filesystem::path p(s);
178 if (p.is_absolute())
179 return true;
181 return true;
182 return false;
183 }
static bool isUNC(const std::string &s)
static bool isDriveAbsolute(const std::string &s)
◆ isDriveAbsolute()
| static bool PathManager::isDriveAbsolute |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 162 of file PathManager.h.
163 {
164
165 return s.size() > 2 && std::isalpha(static_cast<unsigned char>(s[0])) && s[1] == ':' && (s[2] == '\\' || s[2] == '/');
166 }
◆ isDriveRelative()
| static bool PathManager::isDriveRelative |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 168 of file PathManager.h.
169 {
170
171 return s.size() > 1 && std::isalpha(static_cast<unsigned char>(s[0])) && s[1] == ':' && (s.size() == 2 || (s[2] != '\\' && s[2] != '/'));
172 }
◆ isFilenameOnly()
| static bool PathManager::isFilenameOnly |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 197 of file PathManager.h.
198 {
199
201 }
static bool isPathLike(const std::string &s)
◆ isPathLike()
| static bool PathManager::isPathLike |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 185 of file PathManager.h.
186 {
187
189 return true;
191 return true;
193 return true;
194 return false;
195 }
static bool hasDirSep(const std::string &s)
static bool isAbsolutePath(const std::string &s)
static bool isDriveRelative(const std::string &s)
◆ isUNC()
| static bool PathManager::isUNC |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 156 of file PathManager.h.
157 {
158
159 return (s.rfind("\\\\", 0) == 0) || (s.rfind("//", 0) == 0);
160 }
◆ baseDocumentsPath
◆ executableDir
| fs::path PathManager::executableDir = fs::current_path() |
|
inlinestaticprivate |
The documentation for this class was generated from the following file: