| 91 | } |
| 92 | |
| 93 | fextl::string GetApplicationConfig(const std::string_view Program, bool Global) { |
| 94 | fextl::string ConfigFile = GetConfigDirectory(Global); |
| 95 | |
| 96 | if (!Global && !FHU::Filesystem::Exists(ConfigFile) && !FHU::Filesystem::CreateDirectories(ConfigFile)) { |
| 97 | LogMan::Msg::DFmt("Couldn't create config directory: '{}'", ConfigFile); |
| 98 | // Let's go local in this case |
| 99 | return fextl::fmt::format("./{}.json", Program); |
| 100 | } |
| 101 | |
| 102 | ConfigFile += "AppConfig/"; |
| 103 | |
| 104 | // Attempt to create the local folder if it doesn't exist |
| 105 | if (!Global && !FHU::Filesystem::Exists(ConfigFile) && !FHU::Filesystem::CreateDirectories(ConfigFile)) { |
| 106 | // Let's go local in this case |
| 107 | return fextl::fmt::format("./{}.json", Program); |
| 108 | } |
| 109 | |
| 110 | return fextl::fmt::format("{}{}.json", ConfigFile, Program); |
| 111 | } |
| 112 | |
| 113 | static fextl::map<FEXCore::Config::LayerType, fextl::unique_ptr<FEXCore::Config::Layer>> ConfigLayers; |
| 114 | class MetaLayer; |
no test coverage detected