| 382 | } |
| 383 | |
| 384 | LogFilterString::LogFilterString(const char *name, LogField *field, LogFilter::Action action, LogFilter::Operator oper, |
| 385 | char *values) |
| 386 | : LogFilter(name, field, action, oper) |
| 387 | { |
| 388 | // parse the comma-separated list of values and construct array |
| 389 | // |
| 390 | char **val_array = nullptr; |
| 391 | size_t i = 0; |
| 392 | SimpleTokenizer tok(values, ','); |
| 393 | size_t n = tok.getNumTokensRemaining(); |
| 394 | if (n) { |
| 395 | val_array = new char *[n]; |
| 396 | char *t; |
| 397 | while (t = tok.getNext(), t != nullptr) { |
| 398 | val_array[i++] = t; |
| 399 | } |
| 400 | if (i < n) { |
| 401 | Warning("There were invalid values in the definition of filter %s" |
| 402 | "only %zu out of %zu values will be used", |
| 403 | name, i, n); |
| 404 | } |
| 405 | } |
| 406 | _setValues(i, val_array); |
| 407 | delete[] val_array; |
| 408 | } |
| 409 | |
| 410 | LogFilterString::LogFilterString(const char *name, LogField *field, LogFilter::Action action, LogFilter::Operator oper, |
| 411 | size_t num_values, char **value) |
nothing calls this directly
no test coverage detected