| 838 | } |
| 839 | |
| 840 | bool |
| 841 | LDAPExpr::CompareString(const std::string_view s1, int op, const std::string_view s2) |
| 842 | { |
| 843 | switch (op) |
| 844 | { |
| 845 | case LE: |
| 846 | return s1.compare(s2) <= 0; |
| 847 | case GE: |
| 848 | return s1.compare(s2) >= 0; |
| 849 | case EQ: |
| 850 | return PatSubstr(s1, s2); |
| 851 | case APPROX: |
| 852 | return FixupString(s2) == FixupString(s1); |
| 853 | default: |
| 854 | return false; |
| 855 | } |
| 856 | } |
| 857 | |
| 858 | std::string |
| 859 | LDAPExpr::FixupString(const std::string_view s) |