16 #include "sqlite/sqlite3.h"
32 uint8_t *
chartoint(
const unsigned char *guid);
int sqlSetConf(config_key_t id, uint64_t value)
Saves a configuration key to the database.
Definition: database.cpp:198
std::string string_sprintf(const char *format,...)
Allows the format of printf but returns a string Source: http://codereview.stackexchange.com/questions/52522/mimic-sprintf-with-stdstring-output.
Definition: database.cpp:54
config_key_t
Definition: database.h:21
uint8_t * chartoint(const unsigned char *guid)
Converts the GUID from char to int array.
Definition: database.cpp:227
int sqlOpen()
Opens and initializes a sqlite3 database connection.
Definition: database.cpp:76
int sqlExecute(string query)
Executes a SQL statement.
Definition: database.cpp:103
void sqlClose()
Closes the database connection.
Definition: database.cpp:92
char * inttochar(uint8_t *guid)
Converts the GUID from int to char array.
Definition: database.cpp:212
void sqltest()
Definition: database.cpp:258
int sqlSetup()
Sets up the database and creates the needed structure.
Definition: database.cpp:150
Definition: database.h:24
uint64_t sqlGetConf(config_key_t id)
Reads a configuration key from the database.
Definition: database.cpp:163
sqlite_int64 int8to64bit(uint8_t *guid)
Definition: database.cpp:250
Definition: database.h:22
Definition: database.h:23
uint8_t * int64to8bit(sqlite_int64 guid)
Converts the GUID from int64 to int8 array.
Definition: database.cpp:241