| 178 | } |
| 179 | |
| 180 | std::string get_parameter_information(int key, std::string_view info) { |
| 181 | const std::map<int, std::string>* M = nullptr; |
| 182 | auto& parameter_information = get_parameter_information(); |
| 183 | // Hook up the right map (since they are all of the same type) |
| 184 | if (info == "IO") { |
| 185 | M = &(parameter_information.IO_map); |
| 186 | } else if (info == "short") { |
| 187 | M = &(parameter_information.short_desc_map); |
| 188 | } else if (info == "long") { |
| 189 | M = &(parameter_information.description_map); |
| 190 | } else if (info == "units") { |
| 191 | M = &(parameter_information.units_map); |
| 192 | } else { |
| 193 | throw ValueError(format("Bad info string [%s] to get_parameter_information", std::string(info).c_str())); |
| 194 | } |
| 195 | |
| 196 | auto it = M->find(key); |
| 197 | if (it != M->end()) { |
| 198 | return it->second; |
| 199 | } |
| 200 | throw ValueError(format("Unable to match the key [%d] in get_parameter_information for info [%s]", key, std::string(info).c_str())); |
| 201 | } |
| 202 | |
| 203 | /// Return a list of parameters |
| 204 | std::string get_csv_parameter_list() { |
no test coverage detected