MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / AppendStrArrayValue

Function AppendStrArrayValue

FEXCore/include/FEXCore/Config/Config.h:200–210  ·  view source on GitHub ↗

AppendStrArrayValue will append strings to its StringArrayType. If the value was previously a different type, then throw an assert.

Source from the content-addressed store, hash-verified

198 // AppendStrArrayValue will append strings to its StringArrayType.
199 // If the value was previously a different type, then throw an assert.
200 void AppendStrArrayValue(ConfigOption Option, std::string_view Data) {
201 auto it = OptionMap.find(Option);
202 if (it == OptionMap.end()) {
203 // If the option didn't exist as a StringArrayType yet, emplace it.
204 it = OptionMap.emplace(Option, DefaultValues::Type::StringArrayType {}).first;
205 }
206
207 auto& Value = it->second;
208 LOGMAN_THROW_A_FMT(std::holds_alternative<DefaultValues::Type::StringArrayType>(Value), "Tried to get config of invalid type!");
209 std::get<DefaultValues::Type::StringArrayType>(Value).emplace_back(Data);
210 }
211
212 void Erase(ConfigOption Option) {
213 OptionMap.erase(Option);

Callers 1

Calls 2

emplaceMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected