Diffstat (limited to 'libopie2/opiedb/osqlresult.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiedb/osqlresult.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiedb/osqlresult.h b/libopie2/opiedb/osqlresult.h index fc6f01a..92b65a0 100644 --- a/libopie2/opiedb/osqlresult.h +++ b/libopie2/opiedb/osqlresult.h | |||
@@ -6,102 +6,102 @@ | |||
6 | #include <qvaluelist.h> | 6 | #include <qvaluelist.h> |
7 | 7 | ||
8 | 8 | ||
9 | #include "osqlerror.h" | 9 | #include "osqlerror.h" |
10 | 10 | ||
11 | namespace Opie { | 11 | namespace Opie { |
12 | namespace DB { | 12 | namespace DB { |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * ResultItem represents one row of the resulting answer | 15 | * ResultItem represents one row of the resulting answer |
16 | */ | 16 | */ |
17 | class OSQLResultItem { | 17 | class OSQLResultItem { |
18 | public: | 18 | public: |
19 | typedef QValueList<OSQLResultItem> ValueList; | 19 | typedef QValueList<OSQLResultItem> ValueList; |
20 | /** | 20 | /** |
21 | * TableString is used to establish the relations | 21 | * TableString is used to establish the relations |
22 | * between the column name and the real item | 22 | * between the column name and the real item |
23 | */ | 23 | */ |
24 | typedef QMap<QString, QString> TableString; | 24 | typedef QMap<QString, QString> TableString; |
25 | 25 | ||
26 | /** | 26 | /** |
27 | * TableInt is used to establish a relation between a | 27 | * TableInt is used to establish a relation between a |
28 | * position of a column and the row value | 28 | * position of a column and the row value |
29 | */ | 29 | */ |
30 | typedef QMap<int, QString> TableInt; | 30 | typedef QMap<int, QString> TableInt; |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Default c'tor. It has a TableString and a TableInt | 33 | * Default c'tor. It has a TableString and a TableInt |
34 | */ | 34 | */ |
35 | OSQLResultItem(const TableString& = TableString(), | 35 | OSQLResultItem(const TableString& = TableString(), |
36 | const TableInt& = TableInt() ); | 36 | const TableInt& = TableInt() ); |
37 | OSQLResultItem( const OSQLResultItem& ); | 37 | OSQLResultItem( const OSQLResultItem& ); |
38 | ~OSQLResultItem(); | 38 | ~OSQLResultItem(); |
39 | OSQLResultItem &operator=( const OSQLResultItem& ); | 39 | OSQLResultItem &operator=( const OSQLResultItem& ); |
40 | /** | 40 | /** |
41 | * returns the TableString | 41 | * returns the TableString |
42 | */ | 42 | */ |
43 | TableString tableString()const; | 43 | TableString tableString()const; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * returns the TableInt | 46 | * returns the TableInt |
47 | */ | 47 | */ |
48 | TableInt tableInt() const; | 48 | TableInt tableInt() const; |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * retrieves the Data from columnName | 51 | * retrieves the Data from columnName |
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | QString data( const QString& columnName, bool *ok = 0); | 54 | QString data( const QString& columnName, bool *ok = 0) const; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * QString for column number | 57 | * QString for column number |
58 | */ | 58 | */ |
59 | QString data(int columnNumber, bool *ok = 0); | 59 | QString data(int columnNumber, bool *ok = 0) const; |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Date conversion from columnName | 62 | * Date conversion from columnName |
63 | */ | 63 | */ |
64 | QDate dataToDate( const QString& columnName, bool *ok = 0 ); | 64 | QDate dataToDate( const QString& columnName, bool *ok = 0 ); |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Date conversion from column-number | 67 | * Date conversion from column-number |
68 | */ | 68 | */ |
69 | QDate dataToDate( int columnNumber, bool *ok = 0 ); | 69 | QDate dataToDate( int columnNumber, bool *ok = 0 ); |
70 | 70 | ||
71 | QDateTime dataToDateTime( const QString& columName, bool *ok = 0 ); | 71 | QDateTime dataToDateTime( const QString& columName, bool *ok = 0 ); |
72 | QDateTime dataToDateTime( int columnNumber, bool *ok = 0 ); | 72 | QDateTime dataToDateTime( int columnNumber, bool *ok = 0 ); |
73 | private: | 73 | private: |
74 | TableString m_string; | 74 | TableString m_string; |
75 | TableInt m_int; | 75 | TableInt m_int; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * the OSQLResult | 79 | * the OSQLResult |
80 | * either a SQL statement failed or succeeded | 80 | * either a SQL statement failed or succeeded |
81 | */ | 81 | */ |
82 | class OSQLResult { | 82 | class OSQLResult { |
83 | public: | 83 | public: |
84 | /** The State of a Result */ | 84 | /** The State of a Result */ |
85 | enum State{ Success = 0, Failure,Undefined }; | 85 | enum State{ Success = 0, Failure,Undefined }; |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * default c'tor | 88 | * default c'tor |
89 | * @param state The State of the Result | 89 | * @param state The State of the Result |
90 | * @param r ResultItems | 90 | * @param r ResultItems |
91 | * @prarm errors the Errors a OSQLResult created | 91 | * @prarm errors the Errors a OSQLResult created |
92 | */ | 92 | */ |
93 | OSQLResult( enum State state = Undefined, | 93 | OSQLResult( enum State state = Undefined, |
94 | const OSQLResultItem::ValueList& r= OSQLResultItem::ValueList(), | 94 | const OSQLResultItem::ValueList& r= OSQLResultItem::ValueList(), |
95 | const OSQLError::ValueList& errors = OSQLError::ValueList() ); | 95 | const OSQLError::ValueList& errors = OSQLError::ValueList() ); |
96 | ~OSQLResult(); | 96 | ~OSQLResult(); |
97 | State state()const; | 97 | State state()const; |
98 | OSQLError::ValueList errors()const; | 98 | OSQLError::ValueList errors()const; |
99 | OSQLResultItem::ValueList results()const; | 99 | OSQLResultItem::ValueList results()const; |
100 | 100 | ||
101 | void setState( enum State state ); | 101 | void setState( enum State state ); |
102 | void setErrors( const OSQLError::ValueList& error ); | 102 | void setErrors( const OSQLError::ValueList& error ); |
103 | void setResults( const OSQLResultItem::ValueList& result ); | 103 | void setResults( const OSQLResultItem::ValueList& result ); |
104 | 104 | ||
105 | OSQLResultItem first(); | 105 | OSQLResultItem first(); |
106 | OSQLResultItem next(); | 106 | OSQLResultItem next(); |
107 | bool atEnd(); | 107 | bool atEnd(); |