Akonadi::Server::Query::Condition

Search for usage in LXR

Akonadi::Server::Query::Condition Class Reference

#include <query.h>

Public Types

using List = QList<Condition>
 

Public Member Functions

 Condition (LogicOperator op=And)
 
void addColumnCondition (const QString &column, CompareOperator op, const QString &column2)
 
void addCondition (const Condition &condition)
 
void addValueCondition (const QString &column, CompareOperator op, const QList< qint64 > &value)
 
void addValueCondition (const QString &column, CompareOperator op, const QSet< qint64 > &value)
 
void addValueCondition (const QString &column, CompareOperator op, const QVariant &value)
 
bool isEmpty () const
 
void setSubQueryMode (LogicOperator op)
 
Condition::List subConditions () const
 

Detailed Description

Represents a WHERE condition tree.

Definition at line 61 of file query.h.

Member Typedef Documentation

◆ List

A list of conditions.

Definition at line 67 of file query.h.

Constructor & Destructor Documentation

◆ Condition()

Query::Condition::Condition ( LogicOperator op = And)
explicit

Create an empty condition.

Parameters
ophow to combine sub queries.

Definition at line 33 of file query.cpp.

Member Function Documentation

◆ addColumnCondition()

void Condition::addColumnCondition ( const QString & column,
CompareOperator op,
const QString & column2 )

Add a WHERE condition which compares a column with another column.

Parameters
columnThe column that should be compared.
opThe operator used for comparison.
column2The column column is compared to.

Definition at line 22 of file query.cpp.

◆ addCondition()

void Query::Condition::addCondition ( const Condition & condition)

Add a WHERE condition.

Use this method to build hierarchical conditions.

Definition at line 54 of file query.cpp.

◆ addValueCondition() [1/3]

void Akonadi::Server::Query::Condition::addValueCondition ( const QString & column,
CompareOperator op,
const QList< qint64 > & value )
inline

Add a WHERE condition which compares a column with a given value.

This is an overload specially for passing a list of IDs, which is a fairly common case in Akonadi.

Parameters
columnThe column that should be compared.
opThe operator used for comparison.
valueThe value column is compared to.

Definition at line 91 of file query.h.

◆ addValueCondition() [2/3]

void Akonadi::Server::Query::Condition::addValueCondition ( const QString & column,
CompareOperator op,
const QSet< qint64 > & value )
inline

Add a WHERE condition which compares a column with a given value.

This is an overload specially for passing a list of IDs, which is a fairly common case in Akonadi.

Parameters
columnThe column that should be compared.
opThe operator used for comparison.
valueThe value column is compared to.

Definition at line 105 of file query.h.

◆ addValueCondition() [3/3]

void Condition::addValueCondition ( const QString & column,
CompareOperator op,
const QVariant & value )

Add a WHERE condition which compares a column with a given value.

Parameters
columnThe column that should be compared.
opThe operator used for comparison
valueThe value column is compared to.

Definition at line 12 of file query.cpp.

◆ isEmpty()

bool Query::Condition::isEmpty ( ) const

Returns if there are sub conditions.

Definition at line 39 of file query.cpp.

◆ setSubQueryMode()

void Query::Condition::setSubQueryMode ( LogicOperator op)

Set how sub-conditions should be combined, default is And.

Definition at line 49 of file query.cpp.

◆ subConditions()

Condition::List Query::Condition::subConditions ( ) const

Returns the list of sub-conditions.

Definition at line 44 of file query.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.