AppendStrArrayValue will append strings to its StringArrayType. If the value was previously a different type, then throw an assert.
| 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); |
no test coverage detected