summaryrefslogtreecommitdiff
path: root/src/poi-service/poi-common/poi-common-database-utf.h
blob: 613bf037e02e05c70eeafc20373cb1c0865132af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* @licence app begin@
* SPDX-License-Identifier: MPL-2.0
*
* \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen
*
* \file poi-common-database-utf.h
*
* \brief This file is part of the poi proof of concept.
*
* \author Philippe Colliot <philippe.colliot@mpsa.com>
*
* \version 1.1
*
* This Source Code Form is subject to the terms of the
* Mozilla Public License (MPL), v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* For further information see http://www.genivi.org/.
*
* List of changes:
* 10-02-2014, Philippe Colliot, refinement and migration to the new repository
* <date>, <name>, <description of change>
*
* @licence end@
*/
#ifndef __DATABASE_H__
#define __DATABASE_H__
	 
#include <string>
#include <vector>
#include <sqlite3.h>
#include <glibmm/ustring.h>

using namespace std;
	 
class DatabaseUTF
{
	public:
        DatabaseUTF(const char* filename);
        ~DatabaseUTF();
	     
	    bool open(const char* filename);
		bool schema();
		bool add(const char* scheme_filename); 
        vector<vector<Glib::ustring> > query(const char* query);
        void close();
		void beginTransaction();
		void appendTransaction(const char* query);
		void commitTransaction();
	     
	private:
		static int callback(void *NotUsed, int argc, char **argv, char **azColName);
	    sqlite3 *database;
		std::string m_filename;
};
	 
#endif