| 235 | } |
| 236 | |
| 237 | bool LDAPExpr::IsSimple(const StringList& keywords, LocalCache& cache, |
| 238 | bool matchCase ) const |
| 239 | { |
| 240 | if (cache.empty()) |
| 241 | { |
| 242 | cache.resize(keywords.size()); |
| 243 | } |
| 244 | |
| 245 | if (d->m_operator == EQ) |
| 246 | { |
| 247 | StringList::const_iterator index; |
| 248 | if ((index = std::find(keywords.begin(), keywords.end(), matchCase ? d->m_attrName : ToLower(d->m_attrName))) != keywords.end() && |
| 249 | d->m_attrValue.find_first_of(LDAPExprConstants::WILDCARD()) == std::string::npos) |
| 250 | { |
| 251 | cache[index - keywords.begin()] = StringList(1, d->m_attrValue); |
| 252 | return true; |
| 253 | } |
| 254 | } |
| 255 | else if (d->m_operator == OR) |
| 256 | { |
| 257 | for (std::size_t i = 0; i < d->m_args.size( ); i++) |
| 258 | { |
| 259 | if (!d->m_args[i].IsSimple(keywords, cache, matchCase)) |
| 260 | return false; |
| 261 | } |
| 262 | return true; |
| 263 | } |
| 264 | return false; |
| 265 | } |
| 266 | |
| 267 | bool LDAPExpr::IsNull() const |
| 268 | { |