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

Method PatSubstr

Modules/CppMicroServices/src/usLDAPExpr.cpp:520–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520bool LDAPExpr::PatSubstr( const std::string& s, int si, const std::string& pat, int pi )
521{
522 if (pat.size()-pi == 0)
523 return s.size()-si == 0;
524 if (pat[pi] == LDAPExprConstants::WILDCARD())
525 {
526 pi++;
527 for (;;)
528 {
529 if (PatSubstr(s, si, pat, pi))
530 return true;
531 if (s.size()-si == 0)
532 return false;
533 si++;
534 }
535 }
536 else
537 {
538 if (s.size()-si == 0)
539 {
540 return false;
541 }
542 if(s[si] != pat[pi])
543 {
544 return false;
545 }
546 return PatSubstr(s, ++si, pat, ++pi);
547 }
548}
549
550bool LDAPExpr::PatSubstr( const std::string& s, const std::string& pat )
551{

Callers

nothing calls this directly

Calls 2

WILDCARDFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected