Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
us::LDAPFilter Class Reference

An RFC 1960-based Filter. More...

#include <usLDAPFilter.h>

Collaboration diagram for us::LDAPFilter:

Public Member Functions

 LDAPFilter ()
 Creates in invalid LDAPFilter object. Test the validity by using the boolean conversion operator. More...
 
 LDAPFilter (const std::string &filter)
 Creates a LDAPFilter object. This LDAPFilter object may be used to match a ServiceReference object or a ServiceProperties object. More...
 
 LDAPFilter (const LDAPFilter &other)
 Copy constructor. More...
 
 ~LDAPFilter ()
 Destructor. More...
 
 operator bool_type () const
 Boolean conversion operator for validity checking. More...
 
bool Match (const ServiceReferenceBase &reference) const
 Filter using a service's properties. More...
 
bool Match (const ServiceProperties &dictionary) const
 Filter using a ServiceProperties object with case insensitive key lookup. This LDAPFilter is executed using the specified ServiceProperties's keys and values. The keys are looked up in a case insensitive manner. More...
 
bool MatchCase (const ServiceProperties &dictionary) const
 Filter using a ServiceProperties. This LDAPFilter is executed using the specified ServiceProperties's keys and values. The keys are looked up in a normal manner respecting case. More...
 
std::string ToString () const
 Returns this LDAPFilter's filter string. More...
 
bool operator== (const LDAPFilter &other) const
 Compares this LDAPFilter to another LDAPFilter. More...
 
LDAPFilter & operator= (const LDAPFilter &filter)
 Assignment operator. More...
 

Protected Attributes

SharedDataPointer< LDAPFilterData > d
 

Detailed Description

An RFC 1960-based Filter.

A LDAPFilter can be used numerous times to determine if the match argument matches the filter string that was used to create the LDAPFilter.

Some examples of LDAP filters are:

Remarks
This class is thread safe.
See also
LDAPProp for a fluent API generating LDAP filter strings

Definition at line 45 of file usLDAPFilter.h.

Constructor & Destructor Documentation

◆ LDAPFilter() [1/3]

us::LDAPFilter::LDAPFilter ( )

Creates in invalid LDAPFilter object. Test the validity by using the boolean conversion operator.

Calling methods on an invalid LDAPFilter will result in undefined behavior.

◆ LDAPFilter() [2/3]

us::LDAPFilter::LDAPFilter ( const std::string &  filter)

Creates a LDAPFilter object. This LDAPFilter object may be used to match a ServiceReference object or a ServiceProperties object.

If the filter cannot be parsed, an std::invalid_argument will be thrown with a human readable message where the filter became unparsable.

Parameters
[in]filterThe filter string.
Exceptions
std::invalid_argumentIf filter contains an invalid filter string that cannot be parsed.
See also
"Framework specification for a description of the filter string syntax." TODO!

◆ LDAPFilter() [3/3]

us::LDAPFilter::LDAPFilter ( const LDAPFilter &  other)

Copy constructor.

Parameters
[in]otherThe LDAPFilter to copy.

◆ ~LDAPFilter()

us::LDAPFilter::~LDAPFilter ( )

Destructor.

Member Function Documentation

◆ Match() [1/2]

bool us::LDAPFilter::Match ( const ServiceProperties &  dictionary) const

Filter using a ServiceProperties object with case insensitive key lookup. This LDAPFilter is executed using the specified ServiceProperties's keys and values. The keys are looked up in a case insensitive manner.

Parameters
[in]dictionaryThe ServiceProperties whose key/value pairs are used in the match.
Returns
true if the ServiceProperties's values match this filter; false otherwise.

◆ Match() [2/2]

bool us::LDAPFilter::Match ( const ServiceReferenceBase &  reference) const

Filter using a service's properties.

This LDAPFilter is executed using the keys and values of the referenced service's properties. The keys are looked up in a case insensitive manner.

Parameters
[in]referenceThe reference to the service whose properties are used in the match.
Returns
true if the service's properties match this LDAPFilter false otherwise.

◆ MatchCase()

bool us::LDAPFilter::MatchCase ( const ServiceProperties &  dictionary) const

Filter using a ServiceProperties. This LDAPFilter is executed using the specified ServiceProperties's keys and values. The keys are looked up in a normal manner respecting case.

Parameters
[in]dictionaryThe ServiceProperties whose key/value pairs are used in the match.
Returns
true if the ServiceProperties's values match this filter; false otherwise.

◆ operator bool_type()

us::LDAPFilter::operator bool_type ( ) const

Boolean conversion operator for validity checking.

◆ operator=()

LDAPFilter& us::LDAPFilter::operator= ( const LDAPFilter &  filter)

Assignment operator.

Parameters
[in]filterThe LDAPFilter to assign from.
Returns
A reference to this LDAPFilter.

◆ operator==()

bool us::LDAPFilter::operator== ( const LDAPFilter &  other) const

Compares this LDAPFilter to another LDAPFilter.

This implementation returns the result of calling this->ToString() == other.ToString().

Parameters
[in]otherThe object to compare against this LDAPFilter.
Returns
Returns the result of calling this->ToString() == other.ToString().

◆ ToString()

std::string us::LDAPFilter::ToString ( ) const

Returns this LDAPFilter's filter string.

The filter string is normalized by removing whitespace which does not affect the meaning of the filter.

Returns
This LDAPFilter's filter string.

Member Data Documentation

◆ d

SharedDataPointer<LDAPFilterData> us::LDAPFilter::d
protected

Definition at line 160 of file usLDAPFilter.h.


The documentation for this class was generated from the following file: