| 468 | } |
| 469 | |
| 470 | bool |
| 471 | LDAPExpr::IsSimple(StringList const& keywords, LocalCache& cache, bool matchCase) const |
| 472 | { |
| 473 | if (cache.empty()) |
| 474 | { |
| 475 | cache.resize(keywords.size()); |
| 476 | } |
| 477 | |
| 478 | if (d->m_operator == EQ) |
| 479 | { |
| 480 | StringList::const_iterator index; |
| 481 | if ((index |
| 482 | = std::find(keywords.begin(), keywords.end(), matchCase ? d->m_attrName : ToLower(d->m_attrName))) |
| 483 | != keywords.end() |
| 484 | && d->m_attrValue.find_first_of(LDAPExprConstants::WILDCARD()) == std::string::npos) |
| 485 | { |
| 486 | cache[index - keywords.begin()] = StringList(1, d->m_attrValue); |
| 487 | return true; |
| 488 | } |
| 489 | } |
| 490 | else if (d->m_operator == OR) |
| 491 | { |
| 492 | for (auto const& m_arg : d->m_args) |
| 493 | { |
| 494 | if (!m_arg.IsSimple(keywords, cache, matchCase)) |
| 495 | { |
| 496 | return false; |
| 497 | } |
| 498 | } |
| 499 | return true; |
| 500 | } |
| 501 | return false; |
| 502 | } |
| 503 | |
| 504 | bool |
| 505 | LDAPExpr::IsNull() const |