diff options
Diffstat (limited to 'mg_db_gd_sqlite.h')
-rw-r--r-- | mg_db_gd_sqlite.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/mg_db_gd_sqlite.h b/mg_db_gd_sqlite.h new file mode 100644 index 0000000..17de670 --- /dev/null +++ b/mg_db_gd_sqlite.h @@ -0,0 +1,67 @@ +/*! + * \file mg_db_gd_sqlite.h + * \brief A capsule around giantdisc database access + * + * \version $Revision: 1.2 $ + * \date $Date: 2005-04-13 17:42:54 +0100 (Thu, 13 Apr 2005) $ + * \author Wolfgang Rohdewald + * \author Responsible author: $Author: wolfgang61 $ + */ + +#ifndef __MG_DB_GD_H +#define __MG_DB_GD_H + +#include <string> +#include <tag.h> +#include <map> +#include <sqlite3.h> + +using namespace std; + +#include "mg_db.h" + +class mgSQLStringSQLite : public mgSQLStringImp { + public: + mgSQLStringSQLite(const char* s); + ~mgSQLStringSQLite(); + char *unquoted() const; + private: + mutable char* m_unquoted; +}; + +class mgQuerySQLite : public mgQueryImp { + public: + mgQuerySQLite(void *db,string sql,mgQueryNoise noise); + ~mgQuerySQLite(); + char ** Next(); + private: + char **m_table; + int m_rc; +}; + +class mgDbGd : public mgDb { + public: + mgDbGd (bool SeparateThread=false); + ~mgDbGd(); + bool Connect(); + bool Create(); + + bool NeedGenre2(); + long thread_id() { return -1; } + bool FieldExists(string table, string field); + bool Threadsafe(); + const char* Options() const; + const char* HelpText() const; + void *ImplDbHandle() const { return m_db; } + const char *DecadeExpr(); + string Now() const { return "strftime('%s','now')"; } + string Directory() const { return "mgDirectory(mp3file)"; } + protected: + void StartTransaction(); + void Commit(); + private: + sqlite3 *m_db; +}; + + +#endif |