KDbVariableExpressionData

Search for usage in LXR

#include <KDbExpressionData.h>

Inheritance diagram for KDbVariableExpressionData:

Public Member Functions

 KDbVariableExpressionData (const QString &aName)
 
KDbVariableExpressionDataclone () override
 
void getQueryParameters (QList< KDbQuerySchemaParameter > *params) override
 
- Public Member Functions inherited from KDbExpressionData
template<typename T >
T * convert ()
 
template<typename T >
const T * convertConst () const
 
QDebug debug (QDebug dbg, KDb::ExpressionCallStack *callStack) const
 
bool isDateTimeType () const
 
bool isFPNumericType () const
 
bool isIntegerType () const
 
bool isNumericType () const
 
bool isTextType () const
 
bool isValid () const
 
KDbEscapedString toString (const KDbDriver *driver, KDbQuerySchemaParameterValueListIterator *params=nullptr, KDb::ExpressionCallStack *callStack=nullptr) const
 
KDbField::Type type () const
 
KDbField::Type type (KDb::ExpressionCallStack *callStack) const
 
bool validate (KDbParseInfo *parseInfo)
 
bool validate (KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack)
 
- Public Member Functions inherited from QSharedData
 QSharedData (const QSharedData &)
 

Public Attributes

KDbFieldfield
 
QString name
 
KDbTableSchematableForQueryAsterisk
 
int tablePositionForField
 
- Public Attributes inherited from KDbExpressionData
QList< ExplicitlySharedExpressionDataPointerchildren
 
KDb::ExpressionClass expressionClass
 
ExplicitlySharedExpressionDataPointer parent
 
KDbToken token
 

Protected Member Functions

void debugInternal (QDebug dbg, KDb::ExpressionCallStack *callStack) const override
 
KDbEscapedString toStringInternal (const KDbDriver *driver, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const override
 
KDbField::Type typeInternal (KDb::ExpressionCallStack *callStack) const override
 
bool validateInternal (KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack) override
 
- Protected Member Functions inherited from KDbExpressionData
bool addToCallStack (QDebug *dbg, KDb::ExpressionCallStack *callStack) const
 

Detailed Description

Internal data class used to implement implicitly shared class KDbVariableExpression.

Provides thread-safe reference counting.

Definition at line 268 of file KDbExpressionData.h.

Member Function Documentation

◆ debugInternal()

void KDbVariableExpressionData::debugInternal ( QDebug  dbg,
KDb::ExpressionCallStack callStack 
) const
overrideprotectedvirtual

Sends information about this expression to debug output dbg (internal).

Reimplemented from KDbExpressionData.

Definition at line 60 of file KDbVariableExpression.cpp.

◆ typeInternal()

KDbField::Type KDbVariableExpressionData::typeInternal ( KDb::ExpressionCallStack callStack) const
overrideprotectedvirtual

We're assuming it's called after VariableExpr::validate()

Reimplemented from KDbExpressionData.

Definition at line 85 of file KDbVariableExpression.cpp.

◆ validateInternal()

bool KDbVariableExpressionData::validateInternal ( KDbParseInfo *  parseInfo,
KDb::ExpressionCallStack callStack 
)
overrideprotectedvirtual

Validation. Sets field, tablePositionForField and tableForQueryAsterisk members. See addColumn() in parse.y to see how it's used on column adding.

Todo:
shall we also support db name?

Reimplemented from KDbExpressionData.

Definition at line 102 of file KDbVariableExpression.cpp.

Member Data Documentation

◆ field

KDbField* KDbVariableExpressionData::field

0 by default. After successful validate() it will point to 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 283 of file KDbExpressionData.h.

◆ name

QString KDbVariableExpressionData::name

Verbatim name as returned by scanner.

Definition at line 277 of file KDbExpressionData.h.

◆ tableForQueryAsterisk

KDbTableSchema* KDbVariableExpressionData::tableForQueryAsterisk

0 by default. After successful validate() it will point to a table that is referenced by asterisk, i.e. "*.tablename". This is set to nullptr if this variable is not an asterisk of that form.

Definition at line 296 of file KDbExpressionData.h.

◆ tablePositionForField

int KDbVariableExpressionData::tablePositionForField

-1 by default. After successful validate() it will contain 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 291 of file KDbExpressionData.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 04:10:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.