From 86352e32f449ecf00de254674b7dcac72bc34a14 Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 27 Aug 2002 20:17:50 +0000 Subject: Initial check in of the light wrapper library around normal SQL The first driver implementation is a SQLite version --- (limited to 'libsql/osqltable.h') diff --git a/libsql/osqltable.h b/libsql/osqltable.h new file mode 100644 index 0000000..87f7e74 --- a/dev/null +++ b/libsql/osqltable.h @@ -0,0 +1,95 @@ +#ifndef OSQL_TABLE_H +#define OSQL_TABLE_H + +#include +#include +#include + +/** + * OSQLTableItem saves one column of a complete + * table + */ +class OSQLTableItem { +public: + typedef QValueList ValueList; + /** + * Type kinds ( to be extended ) + */ + enum Type { Undefined=-1, Integer=0, BigInteger =1, + Float = 2, VarChar = 4 }; + /** + * A constructor + * @param type the Type of the Column + * @param fieldName the Name of the Column + * @param var a Variant + */ + OSQLTableItem(); + OSQLTableItem( enum Type type, + const QString& fieldName, + const QVariant& var= QVariant() ); + + /** + * copy c'tor + */ + OSQLTableItem( const OSQLTableItem& ); + + /** + * d'tor + */ + ~OSQLTableItem(); + + OSQLTableItem& operator=( const OSQLTableItem& ); + + /** + * the fieldName + */ + QString fieldName() const; + + /** + * the field Type + */ + Type type() const; + QVariant more() const; +private: + class OSQLTableItemPrivate; + OSQLTableItemPrivate* d; + Type m_type; + QString m_field; + QVariant m_var; +}; + +/** + * A OSQLTable consists of OSQLTableItems + */ +class OSQLTable { +public: + typedef QValueList ValueList; + + /** + * @param tableName the Name of the Table + */ + OSQLTable(const QString& tableName); + + /** + * d'tor + */ + ~OSQLTable(); + + /** + * setColumns sets the Columns of the Table + */ + void setColumns( const OSQLTableItem::ValueList& ); + + /** + * returns all columns of the table + */ + OSQLTableItem::ValueList columns() const; + + QString tableName()const; + +private: + QString m_table; + OSQLTableItem::ValueList m_list; +}; + +#endif -- cgit v0.9.0.2