author | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
commit | 6d08277737e22b7a1527124623f3571969073ddf (patch) (side-by-side diff) | |
tree | 4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiedb/osqlquery.h | |
parent | 8e28911f7199f4450ac5eef09482069f9b9caea2 (diff) | |
download | opie-6d08277737e22b7a1527124623f3571969073ddf.zip opie-6d08277737e22b7a1527124623f3571969073ddf.tar.gz opie-6d08277737e22b7a1527124623f3571969073ddf.tar.bz2 |
Move XML class to internal PIM
Add namespaces!!!
Opie::Core and Opie::Core::Private
Opie::Net and Opie::Net::Private
Opie::Ui and Opie::Ui::Private
Opie::MM and Opie::MM::Private
Opie::DB and Opie::DB::Private
PIM classes are not yet converted because we will do other work
on it as well
-rw-r--r-- | libopie2/opiedb/osqlquery.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ -1,122 +1,130 @@ #ifndef OSQL_QUERY_H #define OSQL_QUERY_H #include <qmap.h> #include <qvaluelist.h> #include <qstring.h> +namespace Opie { +namespace DB { + /** I'm not happy with them class OSQLQueryOrder { public: typedef QValueList<OSQLQueryOrder> ValueList; OSQLQueryOrder(const QString& table = QString::null ); OSQLQueryOrder( const OSQLQueryOrder& ); ~OSQLQueryOrder(); void setOrderFields( const QStringList& list ); void setValue( const QString& fieldName, const QString& Value ); void setValues( const QMap<QString, QString>& ); QMap<QString, QString> orders() const; QString orderStatement()const; OSQLQueryOrder &operator=(const OSQLQueryOrder& ); private: QMap<QString, QString> m_fields; class OSQLQueryOrderPrivate; OSQLQueryOrderPrivate* d; }; class OSQLWhere { public: typedef QValueList<OSQLWhere> ValueList; enum Vergleiche { Equal = 0, Like, Greater, GreaterEqual, Smaller, SmallerEqual }; OSQLWhere(const QString& table = QString::null ); ~OSQLWhere(); void setExpression(const QString& key, enum Vergleiche, const QString& ); QString statement()const; private: int m_vergleich; const QString& m_left; const QString& m_right; }; */ class OSQLQuery { public: OSQLQuery(); virtual ~OSQLQuery(); virtual QString query()const = 0; +private: + class Private; + Private *d; }; class OSQLRawQuery : public OSQLQuery { public: OSQLRawQuery( const QString& query ); ~OSQLRawQuery(); QString query() const; private: class OSQLRawQueryPrivate; OSQLRawQueryPrivate* d; QString m_query; }; /* I'm not happy with them again class OSQLSelectQuery : public OSQLQuery { public: OSQLSelectQuery(); ~OSQLSelectQuery(); void setTables( const QStringList& allTablesToQuery ); void setValues( const QString& table, const QStringList& columns ); void setOrder( const OSQLSelectQuery& ); void setOrderList( const OSQLQueryOrder::ValueList& ); void setWhereList( const OSQLWhere& ); void setWhereList( const OSQLWhere::ValueList& ); QString query()const; private: QStringList m_tables; QMap<QString, QStringList> m_values; OSQLQueryOrder::ValueList m_order; OSQLWhere::ValueList m_where; class OSQLSelectQueryPrivate; OSQLSelectQueryPrivate* d; }; class OSQLInsertQuery : public OSQLQuery { public: OSQLInsertQuery(const QString& table); ~OSQLInsertQuery(); void setInserFields( const QStringList& ); void setValue( const QString& field, const QString& value ); void setValues(const QMap<QString, QString>& ); QString query()const; private: QString m_table; QStringList m_fields; QMap<QString, QString> m_values; }; class OSQLDeleteQuery : public OSQLQuery { public: OSQLDeleteQuery(const QString& table); ~OSQLDeleteQuery(); void setWhere( const OSQLWhere& ); void setWheres( const OSQLWhere::ValueList& ); QString query()const; private: QString m_table; OSQLWhere::ValueList m_where; }; class OSQLUpdateQuery : public OSQLQuery { public: OSQLUpdateQuery( const QString& table ); ~OSQLUpdateQuery(); void setWhere( const OSQLWhere& ); void setWheres( const OSQLWhere::ValueList& ); */ /* replaces all previous set Values */ /* void setValue( const QString& field, const QString& value ); void setValue( const QMap<QString, QString> &fields ); QString query() const; }; */ +} +} #endif |