summaryrefslogtreecommitdiff
path: root/libsql/osqlresult.cpp
authormickeyl <mickeyl>2003-08-10 15:42:26 (UTC)
committer mickeyl <mickeyl>2003-08-10 15:42:26 (UTC)
commit90dbd3e9e7139c1280e71f9c77ed4362b8d0f367 (patch) (side-by-side diff)
tree22f0947337ea9b21a1d8f56d04ce3292c9d6f19e /libsql/osqlresult.cpp
parent616e919ff6aea6a30e18edb37128c229e806beae (diff)
downloadopie-90dbd3e9e7139c1280e71f9c77ed4362b8d0f367.zip
opie-90dbd3e9e7139c1280e71f9c77ed4362b8d0f367.tar.gz
opie-90dbd3e9e7139c1280e71f9c77ed4362b8d0f367.tar.bz2
libsql is now a part of libopie2
Diffstat (limited to 'libsql/osqlresult.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libsql/osqlresult.cpp127
1 files changed, 0 insertions, 127 deletions
diff --git a/libsql/osqlresult.cpp b/libsql/osqlresult.cpp
deleted file mode 100644
index 490fb45..0000000
--- a/libsql/osqlresult.cpp
+++ b/dev/null
@@ -1,127 +0,0 @@
-
-#include "osqlquery.h"
-#include "osqlresult.h"
-
-OSQLResultItem::OSQLResultItem( const TableString& string,
- const TableInt& Int)
- : m_string( string ), m_int( Int )
-{
-
-}
-OSQLResultItem::~OSQLResultItem() {
-}
-OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) {
- *this = item;
-}
-OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) {
- m_string = other.m_string;
- m_int = other.m_int;
- return *this;
-}
-OSQLResultItem::TableString OSQLResultItem::tableString()const{
- return m_string;
-}
-OSQLResultItem::TableInt OSQLResultItem::tableInt()const {
- return m_int;
-}
-QString OSQLResultItem::data( const QString& columnName, bool *ok ) {
- TableString::Iterator it = m_string.find( columnName );
-
- /* if found */
- if ( it != m_string.end() ) {
- if ( ok ) *ok = true;
- return it.data();
- }else{
- if ( ok ) *ok = false;
- return QString::null;
- }
-
-}
-QString OSQLResultItem::data( int column, bool *ok ) {
- TableInt::Iterator it = m_int.find( column );
-
- /* if found */
- if ( it != m_int.end() ) {
- if ( ok ) *ok = true;
- return it.data();
- }else{
- if ( ok ) *ok = false;
- return QString::null;
- }
-}
-/*
- * DateFormat is 'YYYY-MM-DD'
- */
-QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) {
- QDate date = QDate::currentDate();
- QString str = data( column, ok );
- if (!str.isEmpty() ) {
- ;// convert
- }
- return date;
-}
-QDate OSQLResultItem::dataToDate( int column, bool *ok ) {
- QDate date = QDate::currentDate();
- QString str = data( column, ok );
- if (!str.isEmpty() ) {
- ;// convert
- }
- return date;
-
-}
-QDateTime OSQLResultItem::dataToDateTime( const QString& column, bool *ok ) {
- QDateTime time = QDateTime::currentDateTime();
- return time;
-}
-QDateTime OSQLResultItem::dataToDateTime( int column, bool *ok ) {
- QDateTime time = QDateTime::currentDateTime();
- return time;
-}
-
-OSQLResult::OSQLResult( enum State state,
- const OSQLResultItem::ValueList& list,
- const OSQLError::ValueList& error )
- : m_state( state ), m_list( list ), m_error( error )
-{
-
-}
-OSQLResult::~OSQLResult() {
-
-}
-OSQLResult::State OSQLResult::state()const {
- return m_state;
-}
-void OSQLResult::setState( OSQLResult::State state ) {
- m_state = state;
-}
-OSQLError::ValueList OSQLResult::errors()const {
- return m_error;
-}
-void OSQLResult::setErrors( const OSQLError::ValueList& err ) {
- m_error = err;
-}
-OSQLResultItem::ValueList OSQLResult::results()const {
- return m_list;
-}
-void OSQLResult::setResults( const OSQLResultItem::ValueList& result ) {
- m_list = result;
-}
-OSQLResultItem OSQLResult::first() {
- it = m_list.begin();
- return (*it);
-}
-OSQLResultItem OSQLResult::next(){
- ++it;
- return (*it);
-}
-bool OSQLResult::atEnd(){
- if ( it == m_list.end() )
- return true;
-
- return false;
-}
-OSQLResultItem::ValueList::ConstIterator OSQLResult::iterator()const {
- OSQLResultItem::ValueList::ConstIterator it;
- it = m_list.begin();
- return it;
-}