sqltypes.h
1/* This file is part of the KDE project
2 Copyright (C) 2003, 2006 Jaroslaw Staniek <js@iidea.pl>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef SQLTYPES_H
21#define SQLTYPES_H
22
23#include <tqvariant.h>
24
25extern int current;
26extern TQString ctoken;
27
28struct dateType
29{
30 int year;
31 int month;
32 int day;
33};
34
35struct realType
36{
37 int integer;
38 int fractional;
39};
40
42struct OrderByColumnInternal
43{
44 typedef TQValueList<OrderByColumnInternal> List;
45 typedef TQValueListConstIterator<OrderByColumnInternal> ListConstIterator;
46 OrderByColumnInternal()
47 : columnNumber(-1)
48 , ascending(true)
49 {
50 }
51
52 void setColumnByNameOrNumber(const TQVariant& nameOrNumber) {
53 if (nameOrNumber.type()==TQVariant::String) {
54 aliasOrName = nameOrNumber.toString();
55 columnNumber = -1;
56 }
57 else {
58 columnNumber = nameOrNumber.toInt();
59 aliasOrName = TQString();
60 }
61 }
62
63 TQString aliasOrName;
64 int columnNumber;
66 bool ascending : 1;
67};
68
70struct SelectOptionsInternal
71{
72 SelectOptionsInternal() : whereExpr(0), orderByColumns(0) {}
73 ~SelectOptionsInternal() {
74 delete orderByColumns; // delete because this is internal temp. structure
75 }
76 KexiDB::BaseExpr* whereExpr;
77 OrderByColumnInternal::List* orderByColumns;
78};
79
80#endif
A base class for all expressions.
Definition expression.h:67