MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / LoadConfig

Method LoadConfig

external/zep/src/editor.cpp:137–158  ·  view source on GitHub ↗

If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that You can even edit it inside zep for immediate changes :)

Source from the content-addressed store, hash-verified

135 // If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that
136 // You can even edit it inside zep for immediate changes :)
137 void ZepEditor::LoadConfig(const fs::path& config_path) {
138 if (!GetFileSystem().Exists(config_path)) {
139 return;
140 }
141
142 try {
143 std::shared_ptr<cpptoml::table> spConfig;
144 spConfig = cpptoml::parse_file(config_path.string());
145 if (spConfig == nullptr)
146 return;
147
148 LoadConfig(spConfig);
149 } catch (cpptoml::parse_exception& ex) {
150 std::ostringstream str;
151 str << config_path.filename().string() << " : Failed to parse. " << ex.what();
152 SetCommandText(str.str());
153 } catch (...) {
154 std::ostringstream str;
155 str << config_path.filename().string() << " : Failed to parse. ";
156 SetCommandText(str.str());
157 }
158 }
159
160 void ZepEditor::LoadConfig(std::shared_ptr<cpptoml::table> spConfig) {
161 try {

Callers

nothing calls this directly

Calls 8

parse_fileFunction · 0.85
string_tolowerFunction · 0.85
ExistsMethod · 0.80
stringMethod · 0.80
strMethod · 0.80
value_orMethod · 0.80
whatMethod · 0.45
SetFlagsMethod · 0.45

Tested by

no test coverage detected