MCPcopy Create free account
hub / github.com/MCJack123/craftos2 / getConfigSettingBool

Function getConfigSettingBool

src/plugin.cpp:52–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50static std::string getConfigSetting(const std::string& name) {return config.pluginData.at(name);}
51static int getConfigSettingInt(const std::string& name) {return std::stoi(config.pluginData.at(name));}
52static bool getConfigSettingBool(const std::string& name) {
53 const std::string val = config.pluginData.at(name);
54 if (val == "true") return true;
55 else if (val == "false") return false;
56 else throw std::invalid_argument("Not a boolean value");
57}
58static void setConfigSetting(const std::string& name, const std::string& value) {config.pluginData[name] = value;}
59static void setConfigSettingInt(const std::string& name, int value) {config.pluginData[name] = std::to_string(value);}
60static void setConfigSettingBool(const std::string& name, bool value) {config.pluginData[name] = value ? "true" : "false";}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected