| 389 | } |
| 390 | |
| 391 | bool ErrorMonitor::VuidAndMessage::Search(const char* vuid_, std::string_view msg) const { |
| 392 | assert(msg_type != VuidAndMessage::Undefined); |
| 393 | const bool vuid_compare = !vuid.empty() ? (vuid == vuid_) : true; |
| 394 | switch (msg_type) { |
| 395 | case ErrorMonitor::VuidAndMessage::String: |
| 396 | return vuid_compare && msg.find(msg_string) != std::string::npos; |
| 397 | case ErrorMonitor::VuidAndMessage::Regex: { |
| 398 | const std::regex msg_regex(msg_string); |
| 399 | return vuid_compare && std::regex_search(msg.data(), msg_regex); |
| 400 | } |
| 401 | default: |
| 402 | return false; |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | bool ErrorMonitor::VuidAndMessage::SearchUndesiredRegex(std::string_view msg) const { |
| 407 | const std::regex undesired_msg_regex(undesired_msg_regex_string); |
no test coverage detected