-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLiteConverter.cpp
More file actions
72 lines (51 loc) · 998 Bytes
/
SQLiteConverter.cpp
File metadata and controls
72 lines (51 loc) · 998 Bytes
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
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef SQLITECONVERTER_CPP
#define SQLITECONVERTER_CPP
#include <QMap>
#include <QString>
#include <QDebug>
#include <QtSql>
#include <QApplication>
class SQLiteConverter {
public:
QSqlDatabase *m_db;
QString path;
SQLiteConverter()
{
m_db = new QSqlDatabase();
m_db->addDatabase("QSQLITE", "mySqlite");
}
SQLiteConverter(QString p)
{
//Constructeur
this->path = QApplication::applicationDirPath() + "/" + p;
m_db = new QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", "mySqlite1"));
m_db->setDatabaseName(this->path);
if (!m_db->open())
{
qDebug() << "Erreur lors de l'ouverture du fichier : " << m_db->lastError();
}
}
bool exportSql()
{
//Donnes a transmettre au serveur web
return true;
}
~SQLiteConverter()
{
//Destructeur
delete m_db;
}
QSqlDatabase *getDatabase()
{
return this->m_db;
}
void setPath(QString path)
{
this->path = path;
}
QString getPath()
{
return this->path;
}
};
#endif