| 966 | } |
| 967 | |
| 968 | LDAPExpr |
| 969 | LDAPExpr::ParseSimple(ParseState& ps) |
| 970 | { |
| 971 | std::string attrName = ps.getAttributeName(); |
| 972 | if (attrName.empty()) |
| 973 | { |
| 974 | ps.error(LDAPExprConstants::MALFORMED()); |
| 975 | } |
| 976 | int op = 0; |
| 977 | if (ps.prefix("=")) |
| 978 | { |
| 979 | op = EQ; |
| 980 | } |
| 981 | else if (ps.prefix("<=")) |
| 982 | { |
| 983 | op = LE; |
| 984 | } |
| 985 | else if (ps.prefix(">=")) |
| 986 | { |
| 987 | op = GE; |
| 988 | } |
| 989 | else if (ps.prefix("~=")) |
| 990 | { |
| 991 | op = APPROX; |
| 992 | } |
| 993 | else |
| 994 | { |
| 995 | // System.out.println("undef op='" + ps.peek() + "'"); |
| 996 | ps.error(LDAPExprConstants::OPERATOR()); // Does not return |
| 997 | } |
| 998 | std::string attrValue = ps.getAttributeValue(); |
| 999 | if (!ps.prefix(")")) |
| 1000 | { |
| 1001 | ps.error(LDAPExprConstants::MALFORMED()); |
| 1002 | } |
| 1003 | return LDAPExpr(op, attrName, attrValue); |
| 1004 | } |
| 1005 | |
| 1006 | const std::string |
| 1007 | LDAPExpr::ToString() const |
nothing calls this directly
no test coverage detected