Set the filter expression.
- Parameters
-
[in] | expr | the new expression |
[in] | icase | true to ignore case on filtering, false otherwise |
- Returns
- *this
- Exceptions
-
Definition at line 96 of file filter.cpp.
References likely, m_expr, and unlikely.
Referenced by filter().
99 throw exception(
"invalid argument: expr (=%p)", expr);
102 i32 flags = REG_EXTENDED | REG_NOSUB;
107 i32 retval = regcomp(&
m_expr, expr, flags);
108 if (
likely(retval == 0) )
112 i32 len = regerror(retval, &
m_expr, NULL, 0);
114 regerror(retval, &
m_expr, errbuf, len);
118 "failed to compile filter '%s' (regex errno %d - %s)",
char i8
8-bit signed integer
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
regex_t m_expr
Filter expression.
int i32
32-bit signed integer
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.