23 #include "usLDAPExpr_p.h"
24 #include "usServicePropertiesImpl_p.h"
26 #include "usServiceReferenceBasePrivate.h"
32 class LDAPFilterData :
public SharedData
36 LDAPFilterData() : ldapExpr()
39 LDAPFilterData(
const std::string& filter)
43 LDAPFilterData(
const LDAPFilterData& other)
44 : SharedData(other), ldapExpr(other.ldapExpr)
50 LDAPFilter::LDAPFilter()
60 d =
new LDAPFilterData(filter);
62 catch (
const std::exception& e)
64 throw std::invalid_argument(e.what());
77 LDAPFilter::operator bool_type()
const
84 return d->ldapExpr.Evaluate(reference.d->GetProperties(),
true);
89 return d->ldapExpr.Evaluate(ServicePropertiesImpl(dictionary),
false);
94 return d->ldapExpr.Evaluate(ServicePropertiesImpl(dictionary),
true);
99 return d->ldapExpr.ToString();
104 return d->ldapExpr.ToString() == other.
d->ldapExpr.ToString();
118 std::ostream&
operator<<(std::ostream& os,
const LDAPFilter& filter)
120 return os << filter.ToString();
bool MatchCase(const ServiceProperties &dictionary) const
LDAPFilter & operator=(const LDAPFilter &filter)
US_Core_EXPORT std::ostream & operator<<(std::ostream &os, ModuleEvent::Type eventType)
SharedDataPointer< LDAPFilterData > d
bool operator==(const LDAPFilter &other) const
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
std::string ToString() const
bool Match(const ServiceReferenceBase &reference) const