CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Protected Attributes | List of all members
ctkLDAPSearchFilter Class Reference

#include <Libs/PluginFramework/ctkLDAPSearchFilter.h>

Public Member Functions

 ctkLDAPSearchFilter ()
 
 ctkLDAPSearchFilter (const ctkLDAPSearchFilter &other)
 
 ctkLDAPSearchFilter (const QString &filter)
 
bool match (const ctkDictionary &dictionary) const
 
bool match (const ctkServiceReference &reference) const
 
bool matchCase (const ctkDictionary &dictionary) const
 
 operator bool () const
 
ctkLDAPSearchFilteroperator= (const ctkLDAPSearchFilter &filter)
 
bool operator== (const ctkLDAPSearchFilter &other) const
 
QString toString () const
 
 ~ctkLDAPSearchFilter ()
 

Protected Attributes

QSharedDataPointer< ctkLDAPSearchFilterData > d
 

Detailed Description

An RFC 1960-based Filter.

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

Some examples of LDAP filters are:

* "(cn=Babs Jensen)"
* "(!(cn=Tim Howes))"
* "(&(" + ctkPluginConstants::OBJECTCLASS + "=Person)(|(sn=Jensen)(cn=Babs J*)))"
*  "(o=univ*of*mich*)"
* 
See also
"CTK Wiki for a description of the filter string syntax." TODO!
Remarks
This class is thread safe.

Definition at line 56 of file ctkLDAPSearchFilter.h.

Constructor & Destructor Documentation

◆ ctkLDAPSearchFilter() [1/3]

ctkLDAPSearchFilter::ctkLDAPSearchFilter ( )

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

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

◆ ctkLDAPSearchFilter() [2/3]

ctkLDAPSearchFilter::ctkLDAPSearchFilter ( const QString &  filter)

Creates a ctkLDAPSearchFilter object. This ctkLDAPSearchFilter object may be used to match a ctkServiceReference object or a ctkDictionary object.

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

Parameters
filterThe filter string.
Returns
A ctkLDAPSearchFilter object encapsulating the filter string.
Exceptions
ctkInvalidArgumentExceptionIf filter contains an invalid filter string that cannot be parsed.
See also
"Framework specification for a description of the filter string syntax." TODO!

◆ ctkLDAPSearchFilter() [3/3]

ctkLDAPSearchFilter::ctkLDAPSearchFilter ( const ctkLDAPSearchFilter other)

◆ ~ctkLDAPSearchFilter()

ctkLDAPSearchFilter::~ctkLDAPSearchFilter ( )

Member Function Documentation

◆ match() [1/2]

bool ctkLDAPSearchFilter::match ( const ctkDictionary dictionary) const

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

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

◆ match() [2/2]

bool ctkLDAPSearchFilter::match ( const ctkServiceReference reference) const

Filter using a service's properties.

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

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

◆ matchCase()

bool ctkLDAPSearchFilter::matchCase ( const ctkDictionary dictionary) const

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

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

◆ operator bool()

ctkLDAPSearchFilter::operator bool ( ) const

◆ operator=()

ctkLDAPSearchFilter& ctkLDAPSearchFilter::operator= ( const ctkLDAPSearchFilter filter)

◆ operator==()

bool ctkLDAPSearchFilter::operator== ( const ctkLDAPSearchFilter other) const

Compares this ctkLDAPSearchFilter to another ctkLDAPSearchFilter.

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

Parameters
otherThe object to compare against this ctkLDAPSearchFilter.
Returns
Returns the result of calling this->toString() == other.toString().

◆ toString()

QString ctkLDAPSearchFilter::toString ( ) const

Returns this ctkLDAPSearchFilter's filter string.

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

Returns
This ctkLDAPSearchFilter's filter string.

Member Data Documentation

◆ d

QSharedDataPointer<ctkLDAPSearchFilterData> ctkLDAPSearchFilter::d
protected

Definition at line 158 of file ctkLDAPSearchFilter.h.


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