| 518 | } |
| 519 | |
| 520 | bool 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 | |
| 550 | bool LDAPExpr::PatSubstr( const std::string& s, const std::string& pat ) |
| 551 | { |