KDbToken

Search for usage in LXR

#include <KDbToken.h>

Public Member Functions

 KDbToken ()
 
 KDbToken (char charToken)
 
 KDbToken (const KDbToken &other)
 
bool isValid () const
 
QString name () const
 
bool operator!= (char charToken) const
 
bool operator!= (KDbToken other) const
 
void operator= (char charToken)
 
bool operator== (char charToken) const
 
bool operator== (KDbToken other) const
 
char toChar () const
 
QString toString (const KDbDriver *driver=nullptr) const
 
int value () const
 

Static Public Member Functions

static QList< KDbTokenallTokens ()
 
static QString toString (KDbToken token, const KDbDriver *driver=nullptr)
 

Static Public Attributes

static const KDbToken AND
 
static const KDbToken AS
 
static const KDbToken AS_EMPTY
 
static const KDbToken ASC
 
static const KDbToken AUTO_INCREMENT
 
static const KDbToken BETWEEN
 
static const KDbToken BETWEEN_AND
 
static const KDbToken BIT
 
static const KDbToken BITWISE_SHIFT_LEFT
 
static const KDbToken BITWISE_SHIFT_RIGHT
 
static const KDbToken BY
 
static const KDbToken CHARACTER_STRING_LITERAL
 
static const KDbToken CONCATENATION
 
static const KDbToken CREATE
 
static const KDbToken DATE_CONST
 
static const KDbToken DATE_TIME_INTEGER
 
static const KDbToken DATETIME_CONST
 
static const KDbToken DESC
 
static const KDbToken DISTINCT
 
static const KDbToken DOUBLE_QUOTED_STRING
 
static const KDbToken EXCEPT
 
static const KDbToken FROM
 
static const KDbToken GREATER_OR_EQUAL
 
static const KDbToken IDENTIFIER
 
static const KDbToken IDENTIFIER_DOT_ASTERISK
 
static const KDbToken ILIKE
 
static const KDbToken INTEGER_CONST
 
static const KDbToken INTERSECT
 
static const KDbToken JOIN
 
static const KDbToken KEY
 
static const KDbToken LEFT
 
static const KDbToken LESS_OR_EQUAL
 
static const KDbToken LIKE
 
static const int maxCharTokenValue = 253
 
static const int maxTokenValue = YYMAXUTOK
 
static const KDbToken NOT
 
static const KDbToken NOT_BETWEEN
 
static const KDbToken NOT_BETWEEN_AND
 
static const KDbToken NOT_EQUAL
 
static const KDbToken NOT_EQUAL2
 
static const KDbToken NOT_LIKE
 
static const KDbToken NOT_SIMILAR_TO
 
static const KDbToken OR
 
static const KDbToken ORDER
 
static const KDbToken PRIMARY
 
static const KDbToken QUERY_PARAMETER
 
static const KDbToken REAL_CONST
 
static const KDbToken RIGHT
 
static const KDbToken SCAN_ERROR
 
static const KDbToken SELECT
 
static const KDbToken SIMILAR_TO
 
static const KDbToken SQL
 
static const KDbToken SQL_FALSE
 
static const KDbToken SQL_IN
 
static const KDbToken SQL_IS
 
static const KDbToken SQL_IS_NOT_NULL
 
static const KDbToken SQL_IS_NULL
 
static const KDbToken SQL_NULL
 
static const KDbToken SQL_ON
 
static const KDbToken SQL_TRUE
 
static const KDbToken SQL_TYPE
 
static const KDbToken TABLE
 
static const KDbToken TABS_OR_SPACES
 
static const KDbToken TIME_AM
 
static const KDbToken TIME_CONST
 
static const KDbToken TIME_PM
 
static const KDbToken UMINUS
 
static const KDbToken UNION
 
static const KDbToken VARCHAR
 
static const KDbToken WHERE
 
static const KDbToken XOR
 

Detailed Description

A type-safe KDbSQL token It can be used in KDb expressions.

See also
KDbExpression

Definition at line 36 of file KDbToken.h.

Constructor & Destructor Documentation

◆ KDbToken() [1/3]

KDbToken::KDbToken ( )
inline

Creates an invalid token.

Todo
add KDbToken(const QByteArray &name)

Definition at line 42 of file KDbToken.h.

◆ KDbToken() [2/3]

KDbToken::KDbToken ( const KDbToken & other)
inline

Definition at line 44 of file KDbToken.h.

◆ KDbToken() [3/3]

KDbToken::KDbToken ( char charToken)

Creates a single-character token Only characters that belong to the grammar are accepted: ';' ',' '.

' '>' '<' '=' '+' '-' '&' '|' '/' '*' '' '~' '#' ':' '(' ')' Invalid KDbToken is created for character that is not accepted.

Definition at line 33 of file KDbToken.cpp.

Member Function Documentation

◆ allTokens()

QList< KDbToken > KDbToken::allTokens ( )
static

Definition at line 122 of file KDbToken.cpp.

◆ isValid()

bool KDbToken::isValid ( ) const
inline
Returns
true if this token is valid

Definition at line 53 of file KDbToken.h.

◆ name()

QString KDbToken::name ( ) const
Returns
name of this token Useful for debugging. For example "NOT_EQUAL" string is returned for the NOT_EQUAL token. A single character is returned for printable single-character tokens. A number is returned for non-printable single-character. "<INVALID_TOKEN>" is returned for an invalid string.

Definition at line 38 of file KDbToken.cpp.

◆ operator!=() [1/2]

bool KDbToken::operator!= ( char charToken) const
inline
Returns
true if this token is not equal to other token

Definition at line 97 of file KDbToken.h.

◆ operator!=() [2/2]

bool KDbToken::operator!= ( KDbToken other) const
inline
Returns
true if this token is not equal to other token

Definition at line 91 of file KDbToken.h.

◆ operator=()

void KDbToken::operator= ( char charToken)
inline

Assigns a token.

Definition at line 100 of file KDbToken.h.

◆ operator==() [1/2]

bool KDbToken::operator== ( char charToken) const
inline
Returns
true if this token is equal to other token

Definition at line 94 of file KDbToken.h.

◆ operator==() [2/2]

bool KDbToken::operator== ( KDbToken other) const
inline
Returns
true if this token is equal to other token

Definition at line 88 of file KDbToken.h.

◆ toChar()

char KDbToken::toChar ( ) const
inline
Returns
character equivalent of this token Only character-based tokens are supported this way (toInt() <= maxCharTokenValue). For unsupported tokens nullptr is returned.

Definition at line 82 of file KDbToken.h.

◆ toString() [1/2]

QString KDbToken::toString ( const KDbDriver * driver = nullptr) const
Returns
string interpretation of this token (as visibe to the user) For example "<>" is returned for the NOT_EQUAL token. Empty string is returned for an invalid string The result may depend on the optional driver parameter. If driver is nullptr, representation for portable KDbSQL dialect is returned.

Definition at line 54 of file KDbToken.cpp.

◆ toString() [2/2]

QString KDbToken::toString ( KDbToken token,
const KDbDriver * driver = nullptr )
static

Like toString(const KDbDriver *driver)

Definition at line 92 of file KDbToken.cpp.

◆ value()

int KDbToken::value ( ) const
inline
Returns
numeric value of this token

Definition at line 85 of file KDbToken.h.

Member Data Documentation

◆ AND

const KDbToken KDbToken::AND
static

Definition at line 151 of file KDbToken.h.

◆ AS

const KDbToken KDbToken::AS
static

Definition at line 106 of file KDbToken.h.

◆ AS_EMPTY

const KDbToken KDbToken::AS_EMPTY
static

Definition at line 107 of file KDbToken.h.

◆ ASC

const KDbToken KDbToken::ASC
static

Definition at line 108 of file KDbToken.h.

◆ AUTO_INCREMENT

const KDbToken KDbToken::AUTO_INCREMENT
static

Definition at line 109 of file KDbToken.h.

◆ BETWEEN

const KDbToken KDbToken::BETWEEN
static

Definition at line 152 of file KDbToken.h.

◆ BETWEEN_AND

const KDbToken KDbToken::BETWEEN_AND
static

Custom tokens are not used in parser but used as an extension in expression classes.

Definition at line 173 of file KDbToken.h.

◆ BIT

const KDbToken KDbToken::BIT
static

Definition at line 110 of file KDbToken.h.

◆ BITWISE_SHIFT_LEFT

const KDbToken KDbToken::BITWISE_SHIFT_LEFT
static

Definition at line 111 of file KDbToken.h.

◆ BITWISE_SHIFT_RIGHT

const KDbToken KDbToken::BITWISE_SHIFT_RIGHT
static

Definition at line 112 of file KDbToken.h.

◆ BY

const KDbToken KDbToken::BY
static

Definition at line 113 of file KDbToken.h.

◆ CHARACTER_STRING_LITERAL

const KDbToken KDbToken::CHARACTER_STRING_LITERAL
static

Definition at line 114 of file KDbToken.h.

◆ CONCATENATION

const KDbToken KDbToken::CONCATENATION
static

Definition at line 115 of file KDbToken.h.

◆ CREATE

const KDbToken KDbToken::CREATE
static

Definition at line 116 of file KDbToken.h.

◆ DATE_CONST

const KDbToken KDbToken::DATE_CONST
static

Definition at line 137 of file KDbToken.h.

◆ DATE_TIME_INTEGER

const KDbToken KDbToken::DATE_TIME_INTEGER
static

Definition at line 169 of file KDbToken.h.

◆ DATETIME_CONST

const KDbToken KDbToken::DATETIME_CONST
static

Definition at line 138 of file KDbToken.h.

◆ DESC

const KDbToken KDbToken::DESC
static

Definition at line 117 of file KDbToken.h.

◆ DISTINCT

const KDbToken KDbToken::DISTINCT
static

Definition at line 118 of file KDbToken.h.

◆ DOUBLE_QUOTED_STRING

const KDbToken KDbToken::DOUBLE_QUOTED_STRING
static

Definition at line 119 of file KDbToken.h.

◆ EXCEPT

const KDbToken KDbToken::EXCEPT
static

Definition at line 154 of file KDbToken.h.

◆ FROM

const KDbToken KDbToken::FROM
static

Definition at line 120 of file KDbToken.h.

◆ GREATER_OR_EQUAL

const KDbToken KDbToken::GREATER_OR_EQUAL
static

Definition at line 125 of file KDbToken.h.

◆ IDENTIFIER

const KDbToken KDbToken::IDENTIFIER
static

Definition at line 141 of file KDbToken.h.

◆ IDENTIFIER_DOT_ASTERISK

const KDbToken KDbToken::IDENTIFIER_DOT_ASTERISK
static

Definition at line 142 of file KDbToken.h.

◆ ILIKE

const KDbToken KDbToken::ILIKE
static

Definition at line 158 of file KDbToken.h.

◆ INTEGER_CONST

const KDbToken KDbToken::INTEGER_CONST
static

Definition at line 133 of file KDbToken.h.

◆ INTERSECT

const KDbToken KDbToken::INTERSECT
static

Definition at line 156 of file KDbToken.h.

◆ JOIN

const KDbToken KDbToken::JOIN
static

Definition at line 121 of file KDbToken.h.

◆ KEY

const KDbToken KDbToken::KEY
static

Definition at line 122 of file KDbToken.h.

◆ LEFT

const KDbToken KDbToken::LEFT
static

Definition at line 123 of file KDbToken.h.

◆ LESS_OR_EQUAL

const KDbToken KDbToken::LESS_OR_EQUAL
static

Definition at line 124 of file KDbToken.h.

◆ LIKE

const KDbToken KDbToken::LIKE
static

Definition at line 157 of file KDbToken.h.

◆ maxCharTokenValue

const int KDbToken::maxCharTokenValue = 253
static

Maximum character token value (253)

Definition at line 74 of file KDbToken.h.

◆ maxTokenValue

const int KDbToken::maxTokenValue = YYMAXUTOK
static

Maximum character token value.

Definition at line 77 of file KDbToken.h.

◆ NOT

const KDbToken KDbToken::NOT
static

Definition at line 160 of file KDbToken.h.

◆ NOT_BETWEEN

const KDbToken KDbToken::NOT_BETWEEN
static

Definition at line 153 of file KDbToken.h.

◆ NOT_BETWEEN_AND

const KDbToken KDbToken::NOT_BETWEEN_AND
static

Definition at line 174 of file KDbToken.h.

◆ NOT_EQUAL

const KDbToken KDbToken::NOT_EQUAL
static

Definition at line 161 of file KDbToken.h.

◆ NOT_EQUAL2

const KDbToken KDbToken::NOT_EQUAL2
static

Definition at line 162 of file KDbToken.h.

◆ NOT_LIKE

const KDbToken KDbToken::NOT_LIKE
static

Definition at line 159 of file KDbToken.h.

◆ NOT_SIMILAR_TO

const KDbToken KDbToken::NOT_SIMILAR_TO
static

Definition at line 165 of file KDbToken.h.

◆ OR

const KDbToken KDbToken::OR
static

Definition at line 163 of file KDbToken.h.

◆ ORDER

const KDbToken KDbToken::ORDER
static

Definition at line 130 of file KDbToken.h.

◆ PRIMARY

const KDbToken KDbToken::PRIMARY
static

Definition at line 131 of file KDbToken.h.

◆ QUERY_PARAMETER

const KDbToken KDbToken::QUERY_PARAMETER
static

Definition at line 143 of file KDbToken.h.

◆ REAL_CONST

const KDbToken KDbToken::REAL_CONST
static

Definition at line 134 of file KDbToken.h.

◆ RIGHT

const KDbToken KDbToken::RIGHT
static

Definition at line 135 of file KDbToken.h.

◆ SCAN_ERROR

const KDbToken KDbToken::SCAN_ERROR
static

Definition at line 150 of file KDbToken.h.

◆ SELECT

const KDbToken KDbToken::SELECT
static

Definition at line 132 of file KDbToken.h.

◆ SIMILAR_TO

const KDbToken KDbToken::SIMILAR_TO
static

Definition at line 164 of file KDbToken.h.

◆ SQL

const KDbToken KDbToken::SQL
static

Definition at line 146 of file KDbToken.h.

◆ SQL_FALSE

const KDbToken KDbToken::SQL_FALSE
static

Definition at line 148 of file KDbToken.h.

◆ SQL_IN

const KDbToken KDbToken::SQL_IN
static

Definition at line 155 of file KDbToken.h.

◆ SQL_IS

const KDbToken KDbToken::SQL_IS
static

Definition at line 127 of file KDbToken.h.

◆ SQL_IS_NOT_NULL

const KDbToken KDbToken::SQL_IS_NOT_NULL
static

Definition at line 129 of file KDbToken.h.

◆ SQL_IS_NULL

const KDbToken KDbToken::SQL_IS_NULL
static

Definition at line 128 of file KDbToken.h.

◆ SQL_NULL

const KDbToken KDbToken::SQL_NULL
static

Definition at line 126 of file KDbToken.h.

◆ SQL_ON

const KDbToken KDbToken::SQL_ON
static

Definition at line 136 of file KDbToken.h.

◆ SQL_TRUE

const KDbToken KDbToken::SQL_TRUE
static

Definition at line 147 of file KDbToken.h.

◆ SQL_TYPE

const KDbToken KDbToken::SQL_TYPE
static

Definition at line 105 of file KDbToken.h.

◆ TABLE

const KDbToken KDbToken::TABLE
static

Definition at line 140 of file KDbToken.h.

◆ TABS_OR_SPACES

const KDbToken KDbToken::TABS_OR_SPACES
static

Definition at line 168 of file KDbToken.h.

◆ TIME_AM

const KDbToken KDbToken::TIME_AM
static

Definition at line 170 of file KDbToken.h.

◆ TIME_CONST

const KDbToken KDbToken::TIME_CONST
static

Definition at line 139 of file KDbToken.h.

◆ TIME_PM

const KDbToken KDbToken::TIME_PM
static

Definition at line 171 of file KDbToken.h.

◆ UMINUS

const KDbToken KDbToken::UMINUS
static

Definition at line 167 of file KDbToken.h.

◆ UNION

const KDbToken KDbToken::UNION
static

Definition at line 149 of file KDbToken.h.

◆ VARCHAR

const KDbToken KDbToken::VARCHAR
static

Definition at line 144 of file KDbToken.h.

◆ WHERE

const KDbToken KDbToken::WHERE
static

Definition at line 145 of file KDbToken.h.

◆ XOR

const KDbToken KDbToken::XOR
static

Definition at line 166 of file KDbToken.h.


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 Tue Mar 26 2024 11:21:01 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.