Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

ctkLDAPExpr Class Reference

LDAP Expression. More...

#include <Libs/PluginFramework/ctkLDAPExpr.h>

List of all members.


class  ParseState
 Contains the current parser position and parsing utility methods.

Public Types

typedef char Byte

Public Member Functions

 ctkLDAPExpr (const QString &filter) throw ( ctkInvalidSyntaxException )
 ctkLDAPExpr (const ctkLDAPExpr &other)
bool evaluate (const ctkDictionary &p, bool matchCase) const
 Evaluate this LDAP filter.
QSet< QString > getMatchedObjectClasses () const
bool isSimple (const QList< QString > &keywords, QHash< int, QList< QString > > &cache, bool matchCase) const
const QString toQString () const

Static Public Member Functions

static bool query (const QString &filter, const ctkDictionary &pd) throw (ctkInvalidSyntaxException)

Static Public Attributes

static const int AND = 0
static const int APPROX = 32
static const int COMPLEX = AND | OR | NOT
static const int EQ = 4
static const int GE = 16
static const int LE = 8
static const int NOT = 2
static const int OR = 1
static const int SIMPLE = EQ | LE | GE | APPROX

Detailed Description

LDAP Expression.

19 May 2010
Xavi Planes

Definition at line 43 of file ctkLDAPExpr.h.

Member Typedef Documentation

typedef char ctkLDAPExpr::Byte

Definition at line 55 of file ctkLDAPExpr.h.

Constructor & Destructor Documentation

ctkLDAPExpr::ctkLDAPExpr ( const QString &  filter  )  throw ( ctkInvalidSyntaxException )

Definition at line 34 of file ctkLDAPExpr.cpp.

ctkLDAPExpr::ctkLDAPExpr ( const ctkLDAPExpr other  ) 

Definition at line 61 of file ctkLDAPExpr.cpp.

Member Function Documentation

bool ctkLDAPExpr::evaluate ( const ctkDictionary p,
bool  matchCase 
) const

Evaluate this LDAP filter.

Definition at line 132 of file ctkLDAPExpr.cpp.

QSet< QString > ctkLDAPExpr::getMatchedObjectClasses (  )  const

Get object class set matched by this LDAP expression. This will not work with wildcards and NOT expressions. If a set can not be determined return null.

std::set of classes matched, otherwise null.

Definition at line 66 of file ctkLDAPExpr.cpp.

bool ctkLDAPExpr::isSimple ( const QList< QString > &  keywords,
QHash< int, QList< QString > > &  cache,
bool  matchCase 
) const

Checks if this LDAP expression is "simple". The definition of a simple filter is:

  • (<it>name</it>=<it>value</it>) is simple if <it>name</it> is a member of the provided keywords, and <it>value</it> does not contain a wildcard character;
  • (| EXPR+ ) is simple if all EXPR expressions are simple;
  • No other expressions are simple.

If the filter is found to be simple, the cache is filled with mappings from the provided keywords to lists of attribute values. The keyword-value-pairs are the ones that satisfy this expression, for the given keywords.

keywords The keywords to look for.
cache An array (indexed by the keyword indexes) of lists to fill in with values saturating this expression.
true if this expression is simple, false otherwise.

Definition at line 105 of file ctkLDAPExpr.cpp.

bool ctkLDAPExpr::query ( const QString &  filter,
const ctkDictionary pd 
) throw (ctkInvalidSyntaxException) [static]

Definition at line 127 of file ctkLDAPExpr.cpp.

const QString ctkLDAPExpr::toQString (  )  const

Definition at line 347 of file ctkLDAPExpr.cpp.

Member Data Documentation

const int ctkLDAPExpr::AND = 0 [static]

Definition at line 46 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::APPROX = 32 [static]

Definition at line 52 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::COMPLEX = AND | OR | NOT [static]

Definition at line 53 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::EQ = 4 [static]

Definition at line 49 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::GE = 16 [static]

Definition at line 51 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::LE = 8 [static]

Definition at line 50 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::NOT = 2 [static]

Definition at line 48 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::OR = 1 [static]

Definition at line 47 of file ctkLDAPExpr.h.

const int ctkLDAPExpr::SIMPLE = EQ | LE | GE | APPROX [static]

Definition at line 54 of file ctkLDAPExpr.h.

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines