Search for usage in LXR

#include <KDbExpression.h>

Inheritance diagram for KDbExpression:

Public Member Functions

 KDbExpression ()
KDbExpression clone () const
QDebug debug (QDebug dbg, KDb::ExpressionCallStack *callStack) const
KDb::ExpressionClass expressionClass () const
void getQueryParameters (QList< KDbQuerySchemaParameter > *params)
bool isBinary () const
bool isConst () const
bool isDateTimeType () const
bool isFPNumericType () const
bool isFunction () const
bool isIntegerType () const
bool isNArg () const
bool isNull () const
bool isNumericType () const
bool isQueryParameter () const
bool isTextType () const
bool isUnary () const
bool isValid () const
bool isVariable () const
bool operator!= (const KDbExpression &e) const
bool operator== (const KDbExpression &e) const
KDbExpression parent () const
void setExpressionClass (KDb::ExpressionClass aClass)
void setToken (KDbToken token)
KDbBinaryExpression toBinary () const
KDbConstExpression toConst () const
KDbFunctionExpression toFunction () const
KDbToken token () const
KDbNArgExpression toNArg () const
KDbQueryParameterExpression toQueryParameter () const
KDbEscapedString toString (const KDbDriver *driver, KDbQuerySchemaParameterValueListIterator *params=nullptr, KDb::ExpressionCallStack *callStack=nullptr) const
KDbUnaryExpression toUnary () const
KDbVariableExpression toVariable () const
KDbField::Type type () const
bool validate (KDbParseInfo *parseInfo)

Static Public Member Functions

static KDb::ExpressionClass classForToken (KDbToken token)

Protected Member Functions

 KDbExpression (const ExplicitlySharedExpressionDataPointer &ptr)
 KDbExpression (KDbExpressionData *data)
 KDbExpression (KDbExpressionData *data, KDb::ExpressionClass aClass, KDbToken token)
void appendChild (const ExplicitlySharedExpressionDataPointer &child)
void appendChild (const KDbExpression &child)
bool checkBeforeInsert (const ExplicitlySharedExpressionDataPointer &child)
QList< ExplicitlySharedExpressionDataPointerchildren () const
int indexOfChild (const KDbExpression &child, int from=0) const
void insertChild (int i, const KDbExpression &child)
void insertEmptyChild (int i)
int lastIndexOfChild (const KDbExpression &child, int from=-1) const
void prependChild (const KDbExpression &child)
bool removeChild (const KDbExpression &child)
void removeChild (int i)
void setLeftOrRight (const KDbExpression &right, int index)
KDbExpression takeChild (int i)

Protected Attributes

ExplicitlySharedExpressionDataPointer d

Detailed Description

The KDbExpression class represents a base class for all expressions.

Definition at line 51 of file KDbExpression.h.

Constructor & Destructor Documentation

◆ KDbExpression()

KDbExpression::KDbExpression ( )

Constructs a null expression.

See also

Definition at line 263 of file KDbExpression.cpp.

Member Function Documentation

◆ children()

QList< ExplicitlySharedExpressionDataPointer > KDbExpression::children ( ) const
the list of children expressions.

Definition at line 370 of file KDbExpression.cpp.

◆ classForToken()

KDb::ExpressionClass KDbExpression::classForToken ( KDbToken  token)
expression class for token token.
support more tokens

Definition at line 596 of file KDbExpression.cpp.

◆ clone()

KDbExpression KDbExpression::clone ( ) const

Creates a deep (not shallow) copy of the KDbExpression.

Definition at line 300 of file KDbExpression.cpp.

◆ expressionClass()

KDb::ExpressionClass KDbExpression::expressionClass ( ) const
class identifier of this expression. Default expressionClass is KDb::UnknownExpression.

Definition at line 315 of file KDbExpression.cpp.

◆ getQueryParameters()

void KDbExpression::getQueryParameters ( QList< KDbQuerySchemaParameter > *  params)

Collects query parameters (messages and types) recursively and saves them to params. The leaf nodes are objects of QueryParameterExpr class.

params must not be 0.

Definition at line 478 of file KDbExpression.cpp.

◆ insertEmptyChild()

void KDbExpression::insertEmptyChild ( int  i)

Used for inserting placeholders, e.g. in KDbBinaryExpression::KDbBinaryExpression()

Definition at line 398 of file KDbExpression.cpp.

◆ isDateTimeType()

bool KDbExpression::isDateTimeType ( ) const
true if type of this object belong to a group of time, date and date/time types.

A covenience method.

See also

Definition at line 360 of file KDbExpression.cpp.

◆ isFPNumericType()

bool KDbExpression::isFPNumericType ( ) const
true if type of this object belong to a group of floating-point numeric types.

A covenience method.

See also

Definition at line 355 of file KDbExpression.cpp.

◆ isIntegerType()

bool KDbExpression::isIntegerType ( ) const
true if type of this object belong to a group of integer types.

A covenience method.

See also

Definition at line 345 of file KDbExpression.cpp.

◆ isNull()

bool KDbExpression::isNull ( ) const
true if this expression is null. Equivalent of expressionClass() == KDb::UnknownExpression.
Returns false for expressions of type KDbField::Null (SQL's NULL).

Definition at line 295 of file KDbExpression.cpp.

◆ isNumericType()

bool KDbExpression::isNumericType ( ) const
true if type of this object belong to a group of numeric types.

A covenience method.

See also

Definition at line 350 of file KDbExpression.cpp.

◆ isTextType()

bool KDbExpression::isTextType ( ) const
true if type of this object belong to a group of text types.

A covenience method.

See also

Definition at line 340 of file KDbExpression.cpp.

◆ isValid()

bool KDbExpression::isValid ( ) const
true if type of this object is not KDbField::InvalidType.

A covenience method.

See also

Definition at line 335 of file KDbExpression.cpp.

◆ parent()

KDbExpression KDbExpression::parent ( ) const
the parent expression.

Definition at line 365 of file KDbExpression.cpp.

◆ setExpressionClass()

void KDbExpression::setExpressionClass ( KDb::ExpressionClass  aClass)

Sets expression class aClass for this expression.

Definition at line 320 of file KDbExpression.cpp.

◆ setLeftOrRight()

void KDbExpression::setLeftOrRight ( const KDbExpression right,
int  index 

Only for KDbBinaryExpression::setLeft() and KDbBinaryExpression::setRight()

Definition at line 574 of file KDbExpression.cpp.

◆ setToken()

void KDbExpression::setToken ( KDbToken  token)

Sets token token for this expression.

Definition at line 310 of file KDbExpression.cpp.

◆ token()

KDbToken KDbExpression::token ( ) const
the token for this expression. Tokens are characters (e.g. '+', '-') or identifiers (e.g. SQL_NULL) of elements used by the KDbSQL parser. By default token is 0.

Definition at line 305 of file KDbExpression.cpp.

◆ toNArg()

KDbNArgExpression KDbExpression::toNArg ( ) const

Convenience type casts.

Definition at line 539 of file KDbExpression.cpp.

◆ toString()

KDbEscapedString KDbExpression::toString ( const KDbDriver driver,
KDbQuerySchemaParameterValueListIterator params = nullptr,
KDb::ExpressionCallStack callStack = nullptr 
) const
string as a representation of this expression element by running recursive calls. param, if not 0, points to a list item containing value of a query parameter (used in QueryParameterExpr). The result may depend on the optional driver parameter. If driver is 0, representation for portable KDbSQL dialect is returned.

Definition at line 469 of file KDbExpression.cpp.

◆ type()

KDbField::Type KDbExpression::type ( ) const
type of this expression, based on effect of its evaluation. Default type is KDbField::InvalidType.
See also

Definition at line 330 of file KDbExpression.cpp.

◆ validate()

bool KDbExpression::validate ( KDbParseInfo *  parseInfo)
true if evaluation of this expression succeeded.

Definition at line 325 of file KDbExpression.cpp.

Member Data Documentation

◆ d

ExplicitlySharedExpressionDataPointer KDbExpression::d

Definition at line 200 of file KDbExpression.h.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:06:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.