28 LDAPPropExpr::LDAPPropExpr(
const std::string& expr)
32 LDAPPropExpr& LDAPPropExpr::operator!()
34 if (m_ldapExpr.empty())
return *
this;
36 m_ldapExpr =
"(!" + m_ldapExpr +
")";
40 LDAPPropExpr::operator std::string()
const
45 bool LDAPPropExpr::IsNull()
const
47 return m_ldapExpr.empty();
52 : m_property(property)
54 if (m_property.empty())
throw std::invalid_argument(
"property must not be empty");
59 if (s.empty())
return LDAPPropExpr(s);
60 return LDAPPropExpr(
"(" + m_property +
"=" + s +
")");
68 LDAPProp::operator LDAPPropExpr ()
const
70 return LDAPPropExpr(
"(" + m_property +
"=*)");
75 return LDAPPropExpr(
"(!(" + m_property +
"=*))");
80 if (s.empty())
return LDAPPropExpr(s);
81 return LDAPPropExpr(
"(!(" + m_property +
"=" + s +
"))");
91 if (s.empty())
return LDAPPropExpr(s);
92 return LDAPPropExpr(
"(" + m_property +
">=" + s +
")");
102 if (s.empty())
return LDAPPropExpr(s);
103 return LDAPPropExpr(
"(" + m_property +
"<=" + s +
")");
113 if (s.empty())
return LDAPPropExpr(s);
114 return LDAPPropExpr(
"(" + m_property +
"~=" + s +
")");
124 us::LDAPPropExpr
operator&&(
const us::LDAPPropExpr& left,
const us::LDAPPropExpr& right)
126 if (left.IsNull())
return right;
127 if (right.IsNull())
return left;
128 return us::LDAPPropExpr(
"(&" + static_cast<std::string>(left) + static_cast<std::string>(right) +
")");
131 us::LDAPPropExpr
operator||(
const us::LDAPPropExpr& left,
const us::LDAPPropExpr& right)
133 if (left.IsNull())
return right;
134 if (right.IsNull())
return left;
135 return us::LDAPPropExpr(
"(|" + static_cast<std::string>(left) + static_cast<std::string>(right) +
")");
us::LDAPPropExpr operator&&(const us::LDAPPropExpr &left, const us::LDAPPropExpr &right)
us::LDAPPropExpr operator||(const us::LDAPPropExpr &left, const us::LDAPPropExpr &right)
LDAPPropExpr Approx(const std::string &s) const
LDAPPropExpr operator==(const std::string &s) const
LDAPPropExpr operator!() const
LDAPProp(const std::string &property)
LDAPPropExpr operator>=(const std::string &s) const
LDAPPropExpr operator<=(const std::string &s) const
LDAPPropExpr operator!=(const std::string &s) const
std::string ToString() const