| 166 | } |
| 167 | |
| 168 | std::string get_value_via_strmap( |
| 169 | const string& conf_string, |
| 170 | std::string_view default_key) |
| 171 | { |
| 172 | auto mp = get_str_map(conf_string); |
| 173 | if (mp.size() != 1) { |
| 174 | return ""; |
| 175 | } |
| 176 | |
| 177 | // if the one-elem "map" is of the form { 'value' : '' } |
| 178 | // replace it with { 'default_key' : 'value' } |
| 179 | const auto& [k, v] = *(mp.begin()); |
| 180 | if (v.empty()) { |
| 181 | return k; |
| 182 | } |
| 183 | return v; |
| 184 | } |
| 185 | |
| 186 | std::string get_value_via_strmap( |
| 187 | const string& conf_string, |
no test coverage detected