KDbToken
#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< KDbToken > | allTokens () |
static QString | toString (KDbToken token, const KDbDriver *driver=nullptr) |
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]
|
inline |
Creates an invalid token.
Definition at line 42 of file KDbToken.h.
◆ KDbToken() [2/3]
|
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()
Definition at line 122 of file KDbToken.cpp.
◆ isValid()
|
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]
|
inline |
- Returns
- true if this token is not equal to other token
Definition at line 97 of file KDbToken.h.
◆ operator!=() [2/2]
|
inline |
- Returns
- true if this token is not equal to other token
Definition at line 91 of file KDbToken.h.
◆ operator=()
|
inline |
Assigns a token.
Definition at line 100 of file KDbToken.h.
◆ operator==() [1/2]
|
inline |
- Returns
- true if this token is equal to other token
Definition at line 94 of file KDbToken.h.
◆ operator==() [2/2]
|
inline |
- Returns
- true if this token is equal to other token
Definition at line 88 of file KDbToken.h.
◆ toChar()
|
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]
- 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]
Like toString(const KDbDriver *driver)
Definition at line 92 of file KDbToken.cpp.
◆ value()
|
inline |
- Returns
- numeric value of this token
Definition at line 85 of file KDbToken.h.
Member Data Documentation
◆ AND
|
static |
Definition at line 151 of file KDbToken.h.
◆ AS
|
static |
Definition at line 106 of file KDbToken.h.
◆ AS_EMPTY
|
static |
Definition at line 107 of file KDbToken.h.
◆ ASC
|
static |
Definition at line 108 of file KDbToken.h.
◆ AUTO_INCREMENT
|
static |
Definition at line 109 of file KDbToken.h.
◆ BETWEEN
|
static |
Definition at line 152 of file KDbToken.h.
◆ 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
|
static |
Definition at line 110 of file KDbToken.h.
◆ BITWISE_SHIFT_LEFT
|
static |
Definition at line 111 of file KDbToken.h.
◆ BITWISE_SHIFT_RIGHT
|
static |
Definition at line 112 of file KDbToken.h.
◆ BY
|
static |
Definition at line 113 of file KDbToken.h.
◆ CHARACTER_STRING_LITERAL
|
static |
Definition at line 114 of file KDbToken.h.
◆ CONCATENATION
|
static |
Definition at line 115 of file KDbToken.h.
◆ CREATE
|
static |
Definition at line 116 of file KDbToken.h.
◆ DATE_CONST
|
static |
Definition at line 137 of file KDbToken.h.
◆ DATE_TIME_INTEGER
|
static |
Definition at line 169 of file KDbToken.h.
◆ DATETIME_CONST
|
static |
Definition at line 138 of file KDbToken.h.
◆ DESC
|
static |
Definition at line 117 of file KDbToken.h.
◆ DISTINCT
|
static |
Definition at line 118 of file KDbToken.h.
◆ DOUBLE_QUOTED_STRING
|
static |
Definition at line 119 of file KDbToken.h.
◆ EXCEPT
|
static |
Definition at line 154 of file KDbToken.h.
◆ FROM
|
static |
Definition at line 120 of file KDbToken.h.
◆ GREATER_OR_EQUAL
|
static |
Definition at line 125 of file KDbToken.h.
◆ IDENTIFIER
|
static |
Definition at line 141 of file KDbToken.h.
◆ IDENTIFIER_DOT_ASTERISK
|
static |
Definition at line 142 of file KDbToken.h.
◆ ILIKE
|
static |
Definition at line 158 of file KDbToken.h.
◆ INTEGER_CONST
|
static |
Definition at line 133 of file KDbToken.h.
◆ INTERSECT
|
static |
Definition at line 156 of file KDbToken.h.
◆ JOIN
|
static |
Definition at line 121 of file KDbToken.h.
◆ KEY
|
static |
Definition at line 122 of file KDbToken.h.
◆ LEFT
|
static |
Definition at line 123 of file KDbToken.h.
◆ LESS_OR_EQUAL
|
static |
Definition at line 124 of file KDbToken.h.
◆ LIKE
|
static |
Definition at line 157 of file KDbToken.h.
◆ maxCharTokenValue
|
static |
Maximum character token value (253)
Definition at line 74 of file KDbToken.h.
◆ maxTokenValue
|
static |
Maximum character token value.
Definition at line 77 of file KDbToken.h.
◆ NOT
|
static |
Definition at line 160 of file KDbToken.h.
◆ NOT_BETWEEN
|
static |
Definition at line 153 of file KDbToken.h.
◆ NOT_BETWEEN_AND
|
static |
Definition at line 174 of file KDbToken.h.
◆ NOT_EQUAL
|
static |
Definition at line 161 of file KDbToken.h.
◆ NOT_EQUAL2
|
static |
Definition at line 162 of file KDbToken.h.
◆ NOT_LIKE
|
static |
Definition at line 159 of file KDbToken.h.
◆ NOT_SIMILAR_TO
|
static |
Definition at line 165 of file KDbToken.h.
◆ OR
|
static |
Definition at line 163 of file KDbToken.h.
◆ ORDER
|
static |
Definition at line 130 of file KDbToken.h.
◆ PRIMARY
|
static |
Definition at line 131 of file KDbToken.h.
◆ QUERY_PARAMETER
|
static |
Definition at line 143 of file KDbToken.h.
◆ REAL_CONST
|
static |
Definition at line 134 of file KDbToken.h.
◆ RIGHT
|
static |
Definition at line 135 of file KDbToken.h.
◆ SCAN_ERROR
|
static |
Definition at line 150 of file KDbToken.h.
◆ SELECT
|
static |
Definition at line 132 of file KDbToken.h.
◆ SIMILAR_TO
|
static |
Definition at line 164 of file KDbToken.h.
◆ SQL
|
static |
Definition at line 146 of file KDbToken.h.
◆ SQL_FALSE
|
static |
Definition at line 148 of file KDbToken.h.
◆ SQL_IN
|
static |
Definition at line 155 of file KDbToken.h.
◆ SQL_IS
|
static |
Definition at line 127 of file KDbToken.h.
◆ SQL_IS_NOT_NULL
|
static |
Definition at line 129 of file KDbToken.h.
◆ SQL_IS_NULL
|
static |
Definition at line 128 of file KDbToken.h.
◆ SQL_NULL
|
static |
Definition at line 126 of file KDbToken.h.
◆ SQL_ON
|
static |
Definition at line 136 of file KDbToken.h.
◆ SQL_TRUE
|
static |
Definition at line 147 of file KDbToken.h.
◆ SQL_TYPE
|
static |
Definition at line 105 of file KDbToken.h.
◆ TABLE
|
static |
Definition at line 140 of file KDbToken.h.
◆ TABS_OR_SPACES
|
static |
Definition at line 168 of file KDbToken.h.
◆ TIME_AM
|
static |
Definition at line 170 of file KDbToken.h.
◆ TIME_CONST
|
static |
Definition at line 139 of file KDbToken.h.
◆ TIME_PM
|
static |
Definition at line 171 of file KDbToken.h.
◆ UMINUS
|
static |
Definition at line 167 of file KDbToken.h.
◆ UNION
|
static |
Definition at line 149 of file KDbToken.h.
◆ VARCHAR
|
static |
Definition at line 144 of file KDbToken.h.
◆ WHERE
|
static |
Definition at line 145 of file KDbToken.h.
◆ XOR
|
static |
Definition at line 166 of file KDbToken.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:14 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.