summaryrefslogtreecommitdiff
path: root/libsql/osqltable.h
Unidiff
Diffstat (limited to 'libsql/osqltable.h') (more/less context) (show whitespace changes)
-rw-r--r--libsql/osqltable.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/libsql/osqltable.h b/libsql/osqltable.h
new file mode 100644
index 0000000..87f7e74
--- a/dev/null
+++ b/libsql/osqltable.h
@@ -0,0 +1,95 @@
1#ifndef OSQL_TABLE_H
2#define OSQL_TABLE_H
3
4#include <qstring.h>
5#include <qvaluelist.h>
6#include <qvariant.h>
7
8/**
9 * OSQLTableItem saves one column of a complete
10 * table
11 */
12class OSQLTableItem {
13public:
14 typedef QValueList<OSQLTableItem> ValueList;
15 /**
16 * Type kinds ( to be extended )
17 */
18 enum Type { Undefined=-1, Integer=0, BigInteger =1,
19 Float = 2, VarChar = 4 };
20 /**
21 * A constructor
22 * @param type the Type of the Column
23 * @param fieldName the Name of the Column
24 * @param var a Variant
25 */
26 OSQLTableItem();
27 OSQLTableItem( enum Type type,
28 const QString& fieldName,
29 const QVariant& var= QVariant() );
30
31 /**
32 * copy c'tor
33 */
34 OSQLTableItem( const OSQLTableItem& );
35
36 /**
37 * d'tor
38 */
39 ~OSQLTableItem();
40
41 OSQLTableItem& operator=( const OSQLTableItem& );
42
43 /**
44 * the fieldName
45 */
46 QString fieldName() const;
47
48 /**
49 * the field Type
50 */
51 Type type() const;
52 QVariant more() const;
53private:
54 class OSQLTableItemPrivate;
55 OSQLTableItemPrivate* d;
56 Type m_type;
57 QString m_field;
58 QVariant m_var;
59};
60
61/**
62 * A OSQLTable consists of OSQLTableItems
63 */
64class OSQLTable {
65public:
66 typedef QValueList<OSQLTable> ValueList;
67
68 /**
69 * @param tableName the Name of the Table
70 */
71 OSQLTable(const QString& tableName);
72
73 /**
74 * d'tor
75 */
76 ~OSQLTable();
77
78 /**
79 * setColumns sets the Columns of the Table
80 */
81 void setColumns( const OSQLTableItem::ValueList& );
82
83 /**
84 * returns all columns of the table
85 */
86 OSQLTableItem::ValueList columns() const;
87
88 QString tableName()const;
89
90private:
91 QString m_table;
92 OSQLTableItem::ValueList m_list;
93};
94
95#endif