xc
SqLiteDatabase.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. PĂ©rez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //SqLiteDatabase.h
22 
23 #ifndef SQLITEDATABASE_H
24 #define SQLITEDATABASE_H
25 
26 #include "SqLiteObject.h"
27 #include <sqlite3.h>
28 #include "utility/utils/sqlitepp/IError.h"
29 #include "utility/utils/sqlitepp/Database.h"
30 #include "utility/utils/sqlitepp/StderrLog.h"
31 
33 //
36  {
37  static Database::Mutex mutex;
38  static StderrLog log;
39  Database db;
40  SqLiteQuery *defaultQuery;
41  static sqlite3_stmt *tmpRes;
42  public:
43  SqLiteDatabase(const std::string &nmb);
44  inline Database &getDB(void)
45  { return db; }
46  bool existeTabla(const std::string &nmbTabla) const;
47  bool borraTabla(const std::string &nmbTabla);
48 
50  SqLiteQuery *NuevaQuery(const std::string &nmb);
51  };
52 #endif
bool borraTabla(const std::string &nmbTabla)
Borra la tabla si existe.
Definition: SqLiteDatabase.cc:47
Mutex container class, used by Lock.
Definition: Database.h:58
bool existeTabla(const std::string &nmbTabla) const
Return true if the table with the argument name exists.
Definition: SqLiteDatabase.cc:35
Definition: Database.h:53
Log class writing to standard error.
Definition: StderrLog.h:34
Clase para consulta SQL.
Definition: SqLiteQuery.h:35
SqLiteDatabase(const std::string &nmb)
Constructor.
Definition: SqLiteDatabase.cc:30
Clase base de los objetos de base de datos.
Definition: SqLiteObject.h:37
Clase para consulta SQL.
Definition: SqLiteDatabase.h:35
SqLiteQuery * NuevaQuery(const std::string &nmb)
Create the quefy with the name being passed as parameter.
Definition: SqLiteDatabase.cc:59
SqLiteQuery * getDefaultQuery(void)
Return the default query.
Definition: SqLiteDatabase.cc:55