KDbVariableExpression

Search for usage in LXR

KDbVariableExpression Class Reference

#include <KDbExpression.h>

Inheritance diagram for KDbVariableExpression:

Public Member Functions

 KDbVariableExpression ()
 
 KDbVariableExpression (const KDbVariableExpression &expr)
 
 KDbVariableExpression (const QString &name)
 
KDbFieldfield () const
 
QString name () const
 
KDbTableSchematableForQueryAsterisk () const
 
int tablePositionForField () const
 
- Public Member Functions inherited from KDbExpression
 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)
 

Protected Member Functions

 KDbVariableExpression (const ExplicitlySharedExpressionDataPointer &ptr)
 
 KDbVariableExpression (KDbExpressionData *data)
 
- Protected Member Functions inherited from KDbExpression
 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)
 

Additional Inherited Members

- Static Public Member Functions inherited from KDbExpression
static KDb::ExpressionClass classForToken (KDbToken token)
 
- Protected Attributes inherited from KDbExpression
ExplicitlySharedExpressionDataPointer d
 

Detailed Description

The KDbVariableExpression class represents variables such as fieldname or tablename.fieldname

Definition at line 452 of file KDbExpression.h.

Constructor & Destructor Documentation

◆ KDbVariableExpression() [1/5]

KDbVariableExpression::KDbVariableExpression ( )

Constructs a null variable expression.

See also
KDbExpression::isNull()

Definition at line 244 of file KDbVariableExpression.cpp.

◆ KDbVariableExpression() [2/5]

KDbVariableExpression::KDbVariableExpression ( const QString & name)
explicit

Constructs variable expression with name name.

Definition at line 250 of file KDbVariableExpression.cpp.

◆ KDbVariableExpression() [3/5]

KDbVariableExpression::KDbVariableExpression ( const KDbVariableExpression & expr)

Constructs a copy of other variable expression expr. Resulting object is not a deep copy but rather a reference to the object expr.

Definition at line 256 of file KDbVariableExpression.cpp.

◆ ~KDbVariableExpression()

KDbVariableExpression::~KDbVariableExpression ( )
override

Definition at line 272 of file KDbVariableExpression.cpp.

◆ KDbVariableExpression() [4/5]

KDbVariableExpression::KDbVariableExpression ( KDbExpressionData * data)
explicitprotected

Definition at line 261 of file KDbVariableExpression.cpp.

◆ KDbVariableExpression() [5/5]

KDbVariableExpression::KDbVariableExpression ( const ExplicitlySharedExpressionDataPointer & ptr)
explicitprotected

Definition at line 267 of file KDbVariableExpression.cpp.

Member Function Documentation

◆ field()

KDbField * KDbVariableExpression::field ( ) const

0 by default. After successful validate() it returns a field, if the variable is of a form "tablename.fieldname" or "fieldname", otherwise (eg. for asterisks) still 0. Only meaningful for column expressions within a query.

Definition at line 281 of file KDbVariableExpression.cpp.

◆ name()

QString KDbVariableExpression::name ( ) const

Verbatim name as returned by scanner.

Definition at line 276 of file KDbVariableExpression.cpp.

◆ tableForQueryAsterisk()

KDbTableSchema * KDbVariableExpression::tableForQueryAsterisk ( ) const

nullptr by default. After successful validate() it returns table that is referenced by asterisk, i.e. "*.tablename". It is nullptr if this variable is not an asterisk of that form.

Definition at line 291 of file KDbVariableExpression.cpp.

◆ tablePositionForField()

int KDbVariableExpression::tablePositionForField ( ) const

-1 by default. After successful validate() it returns a position of a table within query that needs to be bound to the field. This value can be either be -1 if no binding is needed. This value is used in the Parser to call KDbQuerySchema::addField(KDbField* field, int bindToTable); Only meaningful for column expressions within a query.

Definition at line 286 of file KDbVariableExpression.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 Mon Nov 4 2024 16:38:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.