-rw-r--r-- | libopie2/opiedb/osqlresult.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlresult.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp index bad7d8b..268ac8e 100644 --- a/libopie2/opiedb/osqlresult.cpp +++ b/libopie2/opiedb/osqlresult.cpp | |||
@@ -12,47 +12,47 @@ OSQLResultItem::OSQLResultItem( const TableString& string, | |||
12 | OSQLResultItem::~OSQLResultItem() { | 12 | OSQLResultItem::~OSQLResultItem() { |
13 | } | 13 | } |
14 | OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { | 14 | OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { |
15 | *this = item; | 15 | *this = item; |
16 | } | 16 | } |
17 | OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { | 17 | OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { |
18 | m_string = other.m_string; | 18 | m_string = other.m_string; |
19 | m_int = other.m_int; | 19 | m_int = other.m_int; |
20 | return *this; | 20 | return *this; |
21 | } | 21 | } |
22 | OSQLResultItem::TableString OSQLResultItem::tableString()const{ | 22 | OSQLResultItem::TableString OSQLResultItem::tableString()const{ |
23 | return m_string; | 23 | return m_string; |
24 | } | 24 | } |
25 | OSQLResultItem::TableInt OSQLResultItem::tableInt()const { | 25 | OSQLResultItem::TableInt OSQLResultItem::tableInt()const { |
26 | return m_int; | 26 | return m_int; |
27 | } | 27 | } |
28 | QString OSQLResultItem::data( const QString& columnName, bool *ok ) { | 28 | QString OSQLResultItem::data( const QString& columnName, bool *ok ) const { |
29 | TableString::Iterator it = m_string.find( columnName ); | 29 | TableString::ConstIterator it = m_string.find( columnName ); |
30 | 30 | ||
31 | /* if found */ | 31 | /* if found */ |
32 | if ( it != m_string.end() ) { | 32 | if ( it != m_string.end() ) { |
33 | if ( ok ) *ok = true; | 33 | if ( ok ) *ok = true; |
34 | return it.data(); | 34 | return it.data(); |
35 | }else{ | 35 | }else{ |
36 | if ( ok ) *ok = false; | 36 | if ( ok ) *ok = false; |
37 | return QString::null; | 37 | return QString::null; |
38 | } | 38 | } |
39 | 39 | ||
40 | } | 40 | } |
41 | QString OSQLResultItem::data( int column, bool *ok ) { | 41 | QString OSQLResultItem::data( int column, bool *ok ) const { |
42 | TableInt::Iterator it = m_int.find( column ); | 42 | TableInt::ConstIterator it = m_int.find( column ); |
43 | 43 | ||
44 | /* if found */ | 44 | /* if found */ |
45 | if ( it != m_int.end() ) { | 45 | if ( it != m_int.end() ) { |
46 | if ( ok ) *ok = true; | 46 | if ( ok ) *ok = true; |
47 | return it.data(); | 47 | return it.data(); |
48 | }else{ | 48 | }else{ |
49 | if ( ok ) *ok = false; | 49 | if ( ok ) *ok = false; |
50 | return QString::null; | 50 | return QString::null; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | /* | 53 | /* |
54 | * DateFormat is 'YYYY-MM-DD' | 54 | * DateFormat is 'YYYY-MM-DD' |
55 | */ | 55 | */ |
56 | QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) { | 56 | QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) { |
57 | QDate date = QDate::currentDate(); | 57 | QDate date = QDate::currentDate(); |
58 | QString str = data( column, ok ); | 58 | QString str = data( column, ok ); |
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 | |||
@@ -38,38 +38,38 @@ public: | |||
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; |