summaryrefslogtreecommitdiff
path: root/libopie2/opiedb
Unidiff
Diffstat (limited to 'libopie2/opiedb') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiedb/TODO1
-rw-r--r--libopie2/opiedb/opiedb.pro2
-rw-r--r--libopie2/opiedb/osqlbackend.cpp2
-rw-r--r--libopie2/opiedb/osqlbackend.h8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.cpp8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.h6
-rw-r--r--libopie2/opiedb/osqldriver.cpp2
-rw-r--r--libopie2/opiedb/osqldriver.h7
-rw-r--r--libopie2/opiedb/osqlerror.cpp2
-rw-r--r--libopie2/opiedb/osqlerror.h5
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp9
-rw-r--r--libopie2/opiedb/osqlitedriver.h8
-rw-r--r--libopie2/opiedb/osqlmanager.cpp6
-rw-r--r--libopie2/opiedb/osqlmanager.h6
-rw-r--r--libopie2/opiedb/osqlquery.cpp2
-rw-r--r--libopie2/opiedb/osqlquery.h8
-rw-r--r--libopie2/opiedb/osqlresult.cpp2
-rw-r--r--libopie2/opiedb/osqlresult.h8
-rw-r--r--libopie2/opiedb/osqltable.cpp2
-rw-r--r--libopie2/opiedb/osqltable.h7
20 files changed, 95 insertions, 6 deletions
diff --git a/libopie2/opiedb/TODO b/libopie2/opiedb/TODO
index ca04ac6..8b86187 100644
--- a/libopie2/opiedb/TODO
+++ b/libopie2/opiedb/TODO
@@ -1,9 +1,10 @@
1* something like Capabilities of a Driver 1* something like Capabilities of a Driver
2 - ROWID 2 - ROWID
3 - How to declare INTEGER PRIMARY KEY 3 - How to declare INTEGER PRIMARY KEY
4 - Abstract from implementation of some dbs 4 - Abstract from implementation of some dbs
5 - provides( Type::What ) 5 - provides( Type::What )
6 - emit signals directly on arriving of data
6 7
7 * OSQLDriver DriverVersion - DatabaseVersion 8 * OSQLDriver DriverVersion - DatabaseVersion
8 * Better OSQLQueries 9 * Better OSQLQueries
9 - more than OSQLRawQuery \ No newline at end of file 10 - more than OSQLRawQuery \ No newline at end of file
diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro
index c773d6c..147435a 100644
--- a/libopie2/opiedb/opiedb.pro
+++ b/libopie2/opiedb/opiedb.pro
@@ -18,13 +18,13 @@ SOURCES = osqlbackend.cpp \
18 osqlresult.cpp \ 18 osqlresult.cpp \
19 osqltable.cpp \ 19 osqltable.cpp \
20 osqlbackendmanager.cpp \ 20 osqlbackendmanager.cpp \
21 osqlitedriver.cpp 21 osqlitedriver.cpp
22INTERFACES = 22INTERFACES =
23TARGET = opiedb2 23TARGET = opiedb2
24VERSION = 1.8.2 24VERSION = 1.9.0
25INCLUDEPATH = $(OPIEDIR)/include 25INCLUDEPATH = $(OPIEDIR)/include
26DEPENDPATH = $(OPIEDIR)/include 26DEPENDPATH = $(OPIEDIR)/include
27LIBS += -lopiecore2 -lqpe -lsqlite 27LIBS += -lopiecore2 -lqpe -lsqlite
28 28
29!contains( platform, x11 ) { 29!contains( platform, x11 ) {
30 include ( $(OPIEDIR)/include.pro ) 30 include ( $(OPIEDIR)/include.pro )
diff --git a/libopie2/opiedb/osqlbackend.cpp b/libopie2/opiedb/osqlbackend.cpp
index d6c39a9..6e5159f 100644
--- a/libopie2/opiedb/osqlbackend.cpp
+++ b/libopie2/opiedb/osqlbackend.cpp
@@ -1,9 +1,11 @@
1 1
2#include "osqlbackend.h" 2#include "osqlbackend.h"
3 3
4using namespace Opie::DB;
5
4 6
5OSQLBackEnd::OSQLBackEnd( const QString& name, 7OSQLBackEnd::OSQLBackEnd( const QString& name,
6 const QString& vendor, 8 const QString& vendor,
7 const QString& license, 9 const QString& license,
8 const QCString& lib ) 10 const QCString& lib )
9 : m_name( name), m_vendor( vendor), m_license( license ), m_lib( lib ) 11 : m_name( name), m_vendor( vendor), m_license( license ), m_lib( lib )
diff --git a/libopie2/opiedb/osqlbackend.h b/libopie2/opiedb/osqlbackend.h
index ad879a4..28451b6 100644
--- a/libopie2/opiedb/osqlbackend.h
+++ b/libopie2/opiedb/osqlbackend.h
@@ -3,12 +3,15 @@
3#define OSQL_BACKEND_H 3#define OSQL_BACKEND_H
4 4
5#include <qcstring.h> 5#include <qcstring.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qvaluelist.h> 7#include <qvaluelist.h>
8 8
9
10namespace Opie {
11namespace DB {
9/** 12/**
10 * OSQLBackEnd represents an available backend 13 * OSQLBackEnd represents an available backend
11 * to the Opie Database Service 14 * to the Opie Database Service
12 * It's used to easily extend OSQL services by 15 * It's used to easily extend OSQL services by
13 * 3rd party plugins. 16 * 3rd party plugins.
14 * It's used to show 17 * It's used to show
@@ -67,9 +70,14 @@ private:
67 QString m_name; 70 QString m_name;
68 QString m_vendor; 71 QString m_vendor;
69 QString m_license; 72 QString m_license;
70 QCString m_lib; 73 QCString m_lib;
71 bool m_default :1; 74 bool m_default :1;
72 int m_pref; 75 int m_pref;
76 class Private;
77 Private *d;
73}; 78};
74 79
80}
81}
82
75#endif 83#endif
diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp
index 95ed77b..fc18e07 100644
--- a/libopie2/opiedb/osqlbackendmanager.cpp
+++ b/libopie2/opiedb/osqlbackendmanager.cpp
@@ -1,11 +1,15 @@
1#include <qdir.h> 1#include <qdir.h>
2#include <qmap.h> 2#include <qmap.h>
3 3
4#include "osqlbackendmanager.h" 4#include "osqlbackendmanager.h"
5 5
6/**
7 * \todo FIXME CONFIG!!!
8 */
9
6namespace { 10namespace {
7 class Config { 11 class Config {
8 typedef QMap<QString, QString> List; 12 typedef QMap<QString, QString> List;
9 public: 13 public:
10 Config( const QString& fileName ); 14 Config( const QString& fileName );
11 /** 15 /**
@@ -41,12 +45,16 @@ namespace {
41 return true; 45 return true;
42 } 46 }
43 QString Config::value( const QString& key ) { 47 QString Config::value( const QString& key ) {
44 return m_list[key]; 48 return m_list[key];
45 } 49 }
46}; 50};
51
52
53using namespace Opie::DB;
54
47OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) 55OSQLBackEndManager::OSQLBackEndManager( const QStringList& path )
48 :m_path( path ) 56 :m_path( path )
49{ 57{
50} 58}
51OSQLBackEndManager::~OSQLBackEndManager() { 59OSQLBackEndManager::~OSQLBackEndManager() {
52} 60}
diff --git a/libopie2/opiedb/osqlbackendmanager.h b/libopie2/opiedb/osqlbackendmanager.h
index bc357a9..00e81fc 100644
--- a/libopie2/opiedb/osqlbackendmanager.h
+++ b/libopie2/opiedb/osqlbackendmanager.h
@@ -2,19 +2,25 @@
2#define OSQL_BACKEND_MANAGER_H 2#define OSQL_BACKEND_MANAGER_H
3 3
4#include <qstringlist.h> 4#include <qstringlist.h>
5 5
6#include "osqlbackend.h" 6#include "osqlbackend.h"
7 7
8namespace Opie {
9namespace DB {
10
8class OSQLBackEndManager { 11class OSQLBackEndManager {
9public: 12public:
10 OSQLBackEndManager(const QStringList& path ); 13 OSQLBackEndManager(const QStringList& path );
11 ~OSQLBackEndManager(); 14 ~OSQLBackEndManager();
12 OSQLBackEnd::ValueList scan(); 15 OSQLBackEnd::ValueList scan();
13private: 16private:
14 OSQLBackEnd::ValueList scanDir( const QString& dir ); 17 OSQLBackEnd::ValueList scanDir( const QString& dir );
15 OSQLBackEnd file2backend( const QString& file ); 18 OSQLBackEnd file2backend( const QString& file );
16 class OSQLBackEndManagerPrivate; 19 class OSQLBackEndManagerPrivate;
17 OSQLBackEndManagerPrivate* d; 20 OSQLBackEndManagerPrivate* d;
18 QStringList m_path; 21 QStringList m_path;
19}; 22};
23}
24}
25
20#endif 26#endif
diff --git a/libopie2/opiedb/osqldriver.cpp b/libopie2/opiedb/osqldriver.cpp
index 258c116..a6dae77 100644
--- a/libopie2/opiedb/osqldriver.cpp
+++ b/libopie2/opiedb/osqldriver.cpp
@@ -1,10 +1,12 @@
1#include <qpe/qlibrary.h> 1#include <qpe/qlibrary.h>
2 2
3#include "osqldriver.h" 3#include "osqldriver.h"
4 4
5using namespace Opie::DB;
6
5OSQLDriver::OSQLDriver( QLibrary* lib ) 7OSQLDriver::OSQLDriver( QLibrary* lib )
6: QObject(), m_lib(lib) { 8: QObject(), m_lib(lib) {
7} 9}
8OSQLDriver::~OSQLDriver() { 10OSQLDriver::~OSQLDriver() {
9 delete m_lib; 11 delete m_lib;
10} 12}
diff --git a/libopie2/opiedb/osqldriver.h b/libopie2/opiedb/osqldriver.h
index 68d8ee6..492b8dd 100644
--- a/libopie2/opiedb/osqldriver.h
+++ b/libopie2/opiedb/osqldriver.h
@@ -4,12 +4,16 @@
4#include <qobject.h> 4#include <qobject.h>
5#include <qstring.h> 5#include <qstring.h>
6 6
7#include "osqltable.h" 7#include "osqltable.h"
8 8
9class QLibrary; 9class QLibrary;
10
11namespace Opie {
12namespace DB {
13
10class OSQLResult; 14class OSQLResult;
11class OSQLQuery; 15class OSQLQuery;
12class OSQLError; 16class OSQLError;
13 17
14/** 18/**
15 * A OSQLDriver implements the communication with 19 * A OSQLDriver implements the communication with
@@ -81,7 +85,10 @@ private:
81 QLibrary* m_lib; 85 QLibrary* m_lib;
82 class OSQLDriverPrivate; 86 class OSQLDriverPrivate;
83 OSQLDriverPrivate *d; 87 OSQLDriverPrivate *d;
84 88
85}; 89};
86 90
91}
92}
93
87#endif 94#endif
diff --git a/libopie2/opiedb/osqlerror.cpp b/libopie2/opiedb/osqlerror.cpp
index 3890a50..165ba65 100644
--- a/libopie2/opiedb/osqlerror.cpp
+++ b/libopie2/opiedb/osqlerror.cpp
@@ -1,8 +1,10 @@
1#include "osqlerror.h" 1#include "osqlerror.h"
2 2
3using namespace Opie::DB;
4
3OSQLError::OSQLError( const QString& driverText, 5OSQLError::OSQLError( const QString& driverText,
4 const QString& driverDatabaseText, 6 const QString& driverDatabaseText,
5 int type, int subType ) 7 int type, int subType )
6 : m_drvText( driverText ), m_drvDBText( driverDatabaseText ), 8 : m_drvText( driverText ), m_drvDBText( driverDatabaseText ),
7 m_type( type ), m_number( subType ) 9 m_type( type ), m_number( subType )
8{ 10{
diff --git a/libopie2/opiedb/osqlerror.h b/libopie2/opiedb/osqlerror.h
index 35a4368..8fa973d 100644
--- a/libopie2/opiedb/osqlerror.h
+++ b/libopie2/opiedb/osqlerror.h
@@ -1,12 +1,15 @@
1#ifndef OSQL_ERROR_H 1#ifndef OSQL_ERROR_H
2#define OSQL_ERROR_H 2#define OSQL_ERROR_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qvaluelist.h> 5#include <qvaluelist.h>
6 6
7
8namespace Opie {
9namespace DB {
7/** 10/**
8 * OSQLError is the base class of all errors 11 * OSQLError is the base class of all errors
9 */ 12 */
10class OSQLError { 13class OSQLError {
11public: 14public:
12 typedef QValueList<OSQLError> ValueList; 15 typedef QValueList<OSQLError> ValueList;
@@ -53,7 +56,9 @@ private:
53 int m_type; 56 int m_type;
54 int m_number; 57 int m_number;
55 class OSQLErrorPrivate; 58 class OSQLErrorPrivate;
56 OSQLErrorPrivate* d; 59 OSQLErrorPrivate* d;
57}; 60};
58 61
62}
63}
59#endif 64#endif
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp
index 6141504..47bc250 100644
--- a/libopie2/opiedb/osqlitedriver.cpp
+++ b/libopie2/opiedb/osqlitedriver.cpp
@@ -37,12 +37,15 @@
37 37
38// fromLocal8Bit() does not work as expected. Thus it 38// fromLocal8Bit() does not work as expected. Thus it
39// is replaced by fromLatin1() (eilers) 39// is replaced by fromLatin1() (eilers)
40#define __BUGGY_LOCAL8BIT_ 40#define __BUGGY_LOCAL8BIT_
41 41
42 42
43using namespace Opie::DB;
44using namespace Opie::DB::Private;
45
43namespace { 46namespace {
44 struct Query { 47 struct Query {
45 OSQLError::ValueList errors; 48 OSQLError::ValueList errors;
46 OSQLResultItem::ValueList items; 49 OSQLResultItem::ValueList items;
47 OSQLiteDriver *driver; 50 OSQLiteDriver *driver;
48 }; 51 };
@@ -83,21 +86,21 @@ void OSQLiteDriver::setOptions( const QStringList& ) {
83/* 86/*
84 * try to open a db specified via setUrl 87 * try to open a db specified via setUrl
85 * and options 88 * and options
86 */ 89 */
87bool OSQLiteDriver::open() { 90bool OSQLiteDriver::open() {
88 char *error; 91 char *error;
89 odebug << "OSQLiteDriver::open: about to open" << oendl; 92 qDebug("OSQLiteDriver::open: about to open");
90 m_sqlite = sqlite_open(m_url.local8Bit(), 93 m_sqlite = sqlite_open(m_url.local8Bit(),
91 0, 94 0,
92 &error ); 95 &error );
93 96
94 /* failed to open */ 97 /* failed to open */
95 if (m_sqlite == 0l ) { 98 if (m_sqlite == 0l ) {
96 // FIXME set the last error 99 // FIXME set the last error
97 owarn << "OSQLiteDriver::open: " << error << oendl; 100 qWarning("OSQLiteDriver::open: %s", error );
98 free( error ); 101 free( error );
99 return false; 102 return false;
100 } 103 }
101 return true; 104 return true;
102} 105}
103 106
@@ -123,13 +126,13 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) {
123 } 126 }
124 Query query; 127 Query query;
125 query.driver = this; 128 query.driver = this;
126 char *err; 129 char *err;
127 /* SQLITE_OK 0 if return code > 0 == failure */ 130 /* SQLITE_OK 0 if return code > 0 == failure */
128 if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { 131 if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) {
129 owarn << "OSQLiteDriver::query: Error while executing" << oendl; 132 qWarning("OSQLiteDriver::query: Error while executing");
130 free(err ); 133 free(err );
131 // FixMe Errors 134 // FixMe Errors
132 } 135 }
133 136
134 OSQLResult result(OSQLResult::Success, 137 OSQLResult result(OSQLResult::Success,
135 query.items, 138 query.items,
diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h
index 6984539..3e1325b 100644
--- a/libopie2/opiedb/osqlitedriver.h
+++ b/libopie2/opiedb/osqlitedriver.h
@@ -4,12 +4,16 @@
4#include <sqlite.h> 4#include <sqlite.h>
5 5
6#include "osqldriver.h" 6#include "osqldriver.h"
7#include "osqlerror.h" 7#include "osqlerror.h"
8#include "osqlresult.h" 8#include "osqlresult.h"
9 9
10namespace Opie {
11namespace DB {
12namespace Private {
13
10class OSQLiteDriver : public OSQLDriver { 14class OSQLiteDriver : public OSQLDriver {
11 Q_OBJECT 15 Q_OBJECT
12public: 16public:
13 OSQLiteDriver( QLibrary *lib = 0l ); 17 OSQLiteDriver( QLibrary *lib = 0l );
14 ~OSQLiteDriver(); 18 ~OSQLiteDriver();
15 QString id()const; 19 QString id()const;
@@ -28,7 +32,11 @@ private:
28 OSQLResultItem m_items; 32 OSQLResultItem m_items;
29 int handleCallBack( int, char**, char** ); 33 int handleCallBack( int, char**, char** );
30 static int call_back( void*, int, char**, char** ); 34 static int call_back( void*, int, char**, char** );
31 QString m_url; 35 QString m_url;
32 sqlite *m_sqlite; 36 sqlite *m_sqlite;
33}; 37};
38}
39}
40}
41
34#endif 42#endif
diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp
index 766ebe1..990d258 100644
--- a/libopie2/opiedb/osqlmanager.cpp
+++ b/libopie2/opiedb/osqlmanager.cpp
@@ -2,12 +2,14 @@
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "osqlmanager.h" 4#include "osqlmanager.h"
5#include "osqlbackendmanager.h" 5#include "osqlbackendmanager.h"
6#include "osqlitedriver.h" 6#include "osqlitedriver.h"
7 7
8using namespace Opie::DB;
9
8OSQLManager::OSQLManager() { 10OSQLManager::OSQLManager() {
9} 11}
10OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { 12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
11 m_list.clear(); 13 m_list.clear();
12 QString opie = QString::fromLatin1( getenv("OPIEDIR") ); 14 QString opie = QString::fromLatin1( getenv("OPIEDIR") );
13 QString qpe = QString::fromLatin1( getenv("QPEDIR") ); 15 QString qpe = QString::fromLatin1( getenv("QPEDIR") );
@@ -28,24 +30,24 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
28 * beeing in libqpe and not libqte 30 * beeing in libqpe and not libqte
29 */ 31 */
30OSQLDriver* OSQLManager::load( const QString& name ) { 32OSQLDriver* OSQLManager::load( const QString& name ) {
31 OSQLDriver* driver = 0l; 33 OSQLDriver* driver = 0l;
32 34
33 if ( name == "SQLite" ) { 35 if ( name == "SQLite" ) {
34 driver = new OSQLiteDriver(); 36 driver = new Opie::DB::Private::OSQLiteDriver;
35 } 37 }
36 return driver; 38 return driver;
37} 39}
38/* 40/*
39 * same as above 41 * same as above
40 */ 42 */
41OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { 43OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) {
42 OSQLDriver *driver = 0l; 44 OSQLDriver *driver = 0l;
43 if ( end.library() == "builtin" && 45 if ( end.library() == "builtin" &&
44 end.name() == "SQLite" ) 46 end.name() == "SQLite" )
45 driver = new OSQLiteDriver(); 47 driver = new Opie::DB::Private::OSQLiteDriver;
46 48
47 return driver; 49 return driver;
48} 50}
49/* 51/*
50 * let's find the a default with the highes preference 52 * let's find the a default with the highes preference
51 */ 53 */
diff --git a/libopie2/opiedb/osqlmanager.h b/libopie2/opiedb/osqlmanager.h
index 5323b14..ca73c64 100644
--- a/libopie2/opiedb/osqlmanager.h
+++ b/libopie2/opiedb/osqlmanager.h
@@ -5,12 +5,14 @@
5#include <qobject.h> 5#include <qobject.h>
6#include <qstringlist.h> 6#include <qstringlist.h>
7 7
8#include "osqlbackend.h" 8#include "osqlbackend.h"
9 9
10 10
11namespace Opie {
12namespace DB {
11/** 13/**
12 * OSQLManager is responsible for loading 14 * OSQLManager is responsible for loading
13 * and unloading, querying different OSQL 15 * and unloading, querying different OSQL
14 * services 16 * services
15 * Load a OSQLDriver and delete it yourself 17 * Load a OSQLDriver and delete it yourself
16 * 18 *
@@ -56,9 +58,13 @@ public:
56 */ 58 */
57 bool unregisterPath( const QString& path ); 59 bool unregisterPath( const QString& path );
58private: 60private:
59 OSQLBackEnd::ValueList builtIn()const; 61 OSQLBackEnd::ValueList builtIn()const;
60 OSQLBackEnd::ValueList m_list; 62 OSQLBackEnd::ValueList m_list;
61 QStringList m_path; 63 QStringList m_path;
64 class Private;
65 Private *d;
62}; 66};
67}
68}
63 69
64#endif 70#endif
diff --git a/libopie2/opiedb/osqlquery.cpp b/libopie2/opiedb/osqlquery.cpp
index ecd53f2..8270c4c 100644
--- a/libopie2/opiedb/osqlquery.cpp
+++ b/libopie2/opiedb/osqlquery.cpp
@@ -1,9 +1,11 @@
1 1
2#include "osqlquery.h" 2#include "osqlquery.h"
3 3
4using namespace Opie::DB;
5
4OSQLQuery::OSQLQuery() { 6OSQLQuery::OSQLQuery() {
5} 7}
6OSQLQuery::~OSQLQuery() { 8OSQLQuery::~OSQLQuery() {
7} 9}
8 10
9OSQLRawQuery::OSQLRawQuery(const QString& query) 11OSQLRawQuery::OSQLRawQuery(const QString& query)
diff --git a/libopie2/opiedb/osqlquery.h b/libopie2/opiedb/osqlquery.h
index 63c26b0..0265d2b 100644
--- a/libopie2/opiedb/osqlquery.h
+++ b/libopie2/opiedb/osqlquery.h
@@ -4,12 +4,15 @@
4 4
5#include <qmap.h> 5#include <qmap.h>
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7#include <qstring.h> 7#include <qstring.h>
8 8
9 9
10namespace Opie {
11namespace DB {
12
10/** I'm not happy with them 13/** I'm not happy with them
11class OSQLQueryOrder { 14class OSQLQueryOrder {
12public: 15public:
13 typedef QValueList<OSQLQueryOrder> ValueList; 16 typedef QValueList<OSQLQueryOrder> ValueList;
14 OSQLQueryOrder(const QString& table = QString::null ); 17 OSQLQueryOrder(const QString& table = QString::null );
15 OSQLQueryOrder( const OSQLQueryOrder& ); 18 OSQLQueryOrder( const OSQLQueryOrder& );
@@ -44,12 +47,15 @@ private:
44class OSQLQuery { 47class OSQLQuery {
45public: 48public:
46 OSQLQuery(); 49 OSQLQuery();
47 virtual ~OSQLQuery(); 50 virtual ~OSQLQuery();
48 51
49 virtual QString query()const = 0; 52 virtual QString query()const = 0;
53private:
54 class Private;
55 Private *d;
50}; 56};
51 57
52class OSQLRawQuery : public OSQLQuery { 58class OSQLRawQuery : public OSQLQuery {
53public: 59public:
54 OSQLRawQuery( const QString& query ); 60 OSQLRawQuery( const QString& query );
55 ~OSQLRawQuery(); 61 ~OSQLRawQuery();
@@ -116,7 +122,9 @@ public:
116 /* 122 /*
117 void setValue( const QString& field, const QString& value ); 123 void setValue( const QString& field, const QString& value );
118 void setValue( const QMap<QString, QString> &fields ); 124 void setValue( const QMap<QString, QString> &fields );
119 QString query() const; 125 QString query() const;
120}; 126};
121*/ 127*/
128}
129}
122#endif 130#endif
diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp
index 42da356..bad7d8b 100644
--- a/libopie2/opiedb/osqlresult.cpp
+++ b/libopie2/opiedb/osqlresult.cpp
@@ -1,9 +1,11 @@
1 1
2#include "osqlresult.h" 2#include "osqlresult.h"
3 3
4using namespace Opie::DB;
5
4OSQLResultItem::OSQLResultItem( const TableString& string, 6OSQLResultItem::OSQLResultItem( const TableString& string,
5 const TableInt& Int) 7 const TableInt& Int)
6 : m_string( string ), m_int( Int ) 8 : m_string( string ), m_int( Int )
7{ 9{
8 10
9} 11}
diff --git a/libopie2/opiedb/osqlresult.h b/libopie2/opiedb/osqlresult.h
index 9c9efa2..fc6f01a 100644
--- a/libopie2/opiedb/osqlresult.h
+++ b/libopie2/opiedb/osqlresult.h
@@ -4,12 +4,16 @@
4#include <qdatetime.h> 4#include <qdatetime.h>
5#include <qmap.h> 5#include <qmap.h>
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7 7
8 8
9#include "osqlerror.h" 9#include "osqlerror.h"
10
11namespace Opie {
12namespace DB {
13
10/** 14/**
11 * ResultItem represents one row of the resulting answer 15 * ResultItem represents one row of the resulting answer
12 */ 16 */
13class OSQLResultItem { 17class OSQLResultItem {
14public: 18public:
15 typedef QValueList<OSQLResultItem> ValueList; 19 typedef QValueList<OSQLResultItem> ValueList;
@@ -104,9 +108,13 @@ public:
104 OSQLResultItem::ValueList::ConstIterator iterator()const; 108 OSQLResultItem::ValueList::ConstIterator iterator()const;
105private: 109private:
106 enum State m_state; 110 enum State m_state;
107 OSQLResultItem::ValueList m_list; 111 OSQLResultItem::ValueList m_list;
108 OSQLError::ValueList m_error; 112 OSQLError::ValueList m_error;
109 OSQLResultItem::ValueList::Iterator it; 113 OSQLResultItem::ValueList::Iterator it;
114 class Private;
115 Private *d;
110}; 116};
111 117
118}
119}
112#endif 120#endif
diff --git a/libopie2/opiedb/osqltable.cpp b/libopie2/opiedb/osqltable.cpp
index cde40f4..117cf21 100644
--- a/libopie2/opiedb/osqltable.cpp
+++ b/libopie2/opiedb/osqltable.cpp
@@ -1,8 +1,10 @@
1#include "osqltable.h" 1#include "osqltable.h"
2 2
3using namespace Opie::DB;
4
3OSQLTableItem::OSQLTableItem() {} 5OSQLTableItem::OSQLTableItem() {}
4OSQLTableItem::OSQLTableItem( enum Type type, 6OSQLTableItem::OSQLTableItem( enum Type type,
5 const QString& field, 7 const QString& field,
6 const QVariant& var) 8 const QVariant& var)
7 : m_type( type ), m_field( field ), m_var( var ) 9 : m_type( type ), m_field( field ), m_var( var )
8{ 10{
diff --git a/libopie2/opiedb/osqltable.h b/libopie2/opiedb/osqltable.h
index 87f7e74..86c30dd 100644
--- a/libopie2/opiedb/osqltable.h
+++ b/libopie2/opiedb/osqltable.h
@@ -2,12 +2,14 @@
2#define OSQL_TABLE_H 2#define OSQL_TABLE_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qvaluelist.h> 5#include <qvaluelist.h>
6#include <qvariant.h> 6#include <qvariant.h>
7 7
8namespace Opie {
9namespace DB {
8/** 10/**
9 * OSQLTableItem saves one column of a complete 11 * OSQLTableItem saves one column of a complete
10 * table 12 * table
11 */ 13 */
12class OSQLTableItem { 14class OSQLTableItem {
13public: 15public:
@@ -87,9 +89,14 @@ public:
87 89
88 QString tableName()const; 90 QString tableName()const;
89 91
90private: 92private:
91 QString m_table; 93 QString m_table;
92 OSQLTableItem::ValueList m_list; 94 OSQLTableItem::ValueList m_list;
95 class Private;
96 Private *d;
93}; 97};
94 98
99}
100}
101
95#endif 102#endif