* Parses group and category strings to the appropriate LogGroup * and LogGroup enum values. This method sets the group and category members * directly and does not return any values. String values not found will * result in the UNDEFINED value being set. * * @param grp_s std::string containing the human readable LogGroup string * @param ctg_s std::string containing the human readable L
| 267 | * @param ctg_s std::string containing the human readable LogCategory string |
| 268 | */ |
| 269 | static std::pair<LogGroup, LogCategory> parse_group_category(const std::string &grp_s, const std::string &ctg_s) |
| 270 | { |
| 271 | auto grp_item = std::find(LogGroup_str.begin(), LogGroup_str.end(), grp_s); |
| 272 | LogGroup group = (grp_item != LogGroup_str.end() |
| 273 | ? static_cast<LogGroup>(std::distance(LogGroup_str.begin(), grp_item)) |
| 274 | : LogGroup::UNDEFINED); |
| 275 | auto catg_item = std::find(LogCategory_str.begin(), LogCategory_str.end(), ctg_s); |
| 276 | LogCategory category = (catg_item != LogCategory_str.end() |
| 277 | ? static_cast<LogCategory>(std::distance(LogCategory_str.begin(), catg_item)) |
| 278 | : LogCategory::UNDEFINED); |
| 279 | return std::make_pair(group, category); |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Parses a GVariant object containing a Log signal. The input |