MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetConfigPath

Method GetConfigPath

src/game_config.cpp:404–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404std::string Game_Config::GetConfigPath(CmdlineParser& cp) {
405 std::string path;
406
407 while (!cp.Done()) {
408 CmdlineArg arg;
409 if (cp.ParseNext(arg, 1, "--config-path", 'c')) {
410 if (arg.NumValues() > 0) {
411 path = arg.Value(0);
412 path = FileFinder::MakeCanonical(path, 0);
413 }
414 continue;
415 }
416
417 cp.SkipNext();
418 }
419
420 if (!path.empty()) {
421 if (!FileFinder::Root().MakeDirectory(path, true)) {
422 Output::Debug("Could not create global config directory {}", path);
423 path.clear();
424 }
425 }
426
427 return path;
428}
429
430void Game_Config::LoadFromArgs(CmdlineParser& cp) {
431 font_path.clear();

Callers

nothing calls this directly

Calls 8

ParseNextMethod · 0.80
NumValuesMethod · 0.80
ValueMethod · 0.80
SkipNextMethod · 0.80
DoneMethod · 0.45
emptyMethod · 0.45
MakeDirectoryMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected