MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetConfigInt

Function GetConfigInt

BG3Extender/Extender/Shared/ExtensionState.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151 }
152
153 std::optional<int32_t> GetConfigInt(Value const& node, std::string_view const& key)
154 {
155 auto v = node.FindMember(key.data());
156 if (v != node.MemberEnd()) {
157 if (v->value.IsInt()) {
158 return v->value.GetInt();
159 } else {
160 OsiError("Config option '" << key << "' should be an integer.");
161 }
162 }
163
164 return {};
165 }
166
167 std::optional<STDString> GetConfigString(Value const& node, std::string_view const& key)
168 {

Callers 1

LoadModConfigFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected