MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / load

Method load

source/MaaToolkit/Config/GlobalOptionConfig.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool GlobalOptionConfig::load()
45{
46 LogFunc << VAR(config_path_);
47
48 auto json_opt = json::open(config_path_, true, true);
49 if (!json_opt) {
50 LogError << "Failed to open json file" << config_path_;
51 return false;
52 }
53
54 auto& json = *json_opt;
55
56 if (!json.is<Option>()) {
57 LogError << "Json is not an Option" << VAR(json);
58 return false;
59 }
60
61 option_ = (Option)json;
62 return true;
63}
64
65bool GlobalOptionConfig::apply_option()
66{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected