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

Method IsSimple

Modules/CppMicroServices/src/usLDAPExpr.cpp:237–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237bool 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
267bool LDAPExpr::IsNull() const
268{

Callers 1

CheckSimpleMethod · 0.80

Calls 5

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

Tested by

no test coverage detected