MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / IsSimple

Method IsSimple

framework/src/util/LDAPExpr.cpp:470–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

CheckSimple_unlockedMethod · 0.80

Calls 6

ToLowerFunction · 0.85
WILDCARDFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected