MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / autoCreateDirectory

Function autoCreateDirectory

src/OpenLoco/src/Environment.cpp:208–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206 }
207
208 void autoCreateDirectory(const fs::path& path)
209 {
210 try
211 {
212 if (!fs::is_directory(path))
213 {
214 auto path8 = path.u8string();
215 Logging::info("Creating directory: {}", path8.c_str());
216 fs::create_directories(path);
217 // clang-format off
218 fs::permissions(
219 path,
220 fs::perms::owner_all |
221 fs::perms::group_read | fs::perms::group_exec |
222 fs::perms::others_read | fs::perms::others_exec);
223 // clang-format on
224 }
225 }
226 catch (const std::exception& e)
227 {
228 Logging::error("Unable to create directory: {}", e.what());
229 Ui::showMessageBox("Unable to create directory", e.what());
230 }
231 }
232
233 static fs::path tryPathOrDefault(fs::path pathToTry, PathId defaultPathId)
234 {

Callers 7

loadHeightmapOpenFunction · 0.85
autosaveFunction · 0.85
resolveLocoInstallPathFunction · 0.85
tryPathOrDefaultFunction · 0.85
resolvePathsFunction · 0.85
writeFunction · 0.85
prepareSaveScreenshotFunction · 0.85

Calls 4

infoFunction · 0.85
errorFunction · 0.85
showMessageBoxFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected