kexi
KexiDB::Parser Class Reference
#include <parser.h>
Detailed Description
Parser for sql statements.
Definition at line 93 of file parser.h.
Public Types | |
OP_None = 0 | |
OP_Error | |
OP_CreateTable | |
OP_AlterTable | |
OP_Select | |
OP_Insert | |
OP_Update | |
OP_Delete | |
enum | OPCode { OP_None = 0, OP_Error, OP_CreateTable, OP_AlterTable, OP_Select, OP_Insert, OP_Update, OP_Delete } |
Public Member Functions | |
Parser (Connection *connection) | |
~Parser () | |
bool | parse (const QString &statement) |
void | clear () |
OPCode | operation () const |
QString | operationString () const |
TableSchema * | table () |
QuerySchema * | query () |
Connection * | db () const |
ParserError | error () const |
QString | statement () const |
void | setOperation (OPCode op) |
void | createTable (const char *t) |
void | setQuerySchema (QuerySchema *query) |
QuerySchema * | select () const |
void | setError (const ParserError &err) |
bool | isReservedKeyword (const char *str) |
Protected Member Functions | |
void | init () |
Protected Attributes | |
ParserError | m_error |
ParserPrivate * | d |
Member Enumeration Documentation
Constructor & Destructor Documentation
Parser::Parser | ( | Connection * | connection | ) |
constructs an empty object of the parser
- Parameters:
-
connection is used for things like wildcard resolution. If 0 parser works in "pure mode"
Definition at line 31 of file parser.cpp.
Member Function Documentation
void Parser::clear | ( | ) |
Connection * Parser::db | ( | ) | const |
- Returns:
- a pointer to the used database connection or 0 if not set You can call this method only once every time after doing parse(). Next time, the call will return 0.
Definition at line 71 of file parser.cpp.
ParserError Parser::error | ( | ) | const |
returns detailed information about last error.
If no error occured ParserError isNull()
Definition at line 73 of file parser.cpp.
bool Parser::isReservedKeyword | ( | const char * | str | ) |
return true if the
- Parameters:
-
str is an reserved keyword (see tokens.cpp for a list of reserved keywords).
Definition at line 110 of file parser.cpp.
Parser::OPCode Parser::operation | ( | ) | const |
QString Parser::operationString | ( | ) | const |
bool Parser::parse | ( | const QString & | statement | ) |
QuerySchema * Parser::query | ( | ) |
- Returns:
- a pointer to KexiDBSelect if 'SELECT ...' was called or 0 on any other operation or error. Returned object is owned by you. You can call this method only once every time after doing parse(). Next time, the call will return 0.
Definition at line 69 of file parser.cpp.
QString Parser::statement | ( | ) | const |
- Returns:
- the statement passed on the last parse method-call.
Definition at line 75 of file parser.cpp.
TableSchema * Parser::table | ( | ) |
- Returns:
- a pointer to a KexiDBTable on CREATE TABLE or 0 on any other operation or error. Returned object is owned by you. You can call this method only once every time after doing parse(). Next time, the call will return 0.
Definition at line 67 of file parser.cpp.
The documentation for this class was generated from the following files: