-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatabase.h
39 lines (27 loc) · 809 Bytes
/
database.h
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
#pragma once
#include <string>
#include "mini/ini.h"
#include "sqlite3.h"
class Database {
public:
Database();
~Database();
void readUserAgents(std::string path);
bool insertHbbtv(std::string json);
bool insertChannel(std::string json);
std::string getRedButtonUrl(std::string channelId);
std::string getChannel(std::string channelId);
std::string getMainApp(std::string channelId);
std::string getUserAgent(std::string channelId);
void shutdown();
void printFatal();
std::string getAppUrl(const std::string basicString, const std::string basicString1);
private:
void createTables();
private:
sqlite3 *db;
sqlite3_stmt* insertHbbtvStmt;
sqlite3_stmt* insertChannelStmt;
mINI::INIStructure userAgents;
};
extern Database database;