ac61c26d56
add: improved sql calls
42 lines
610 B
C++
42 lines
610 B
C++
#ifndef EMGAUWA_CORE_DEVICE_DBO_H
|
|
#define EMGAUWA_CORE_DEVICE_DBO_H
|
|
|
|
#include <string>
|
|
#include <sqlite3.h>
|
|
#include <json/value.h>
|
|
|
|
class device_dbo
|
|
{
|
|
public:
|
|
|
|
char id[33];
|
|
char name[128];
|
|
char ip[17];
|
|
bool active;
|
|
int port;
|
|
int relay_count;
|
|
|
|
bool
|
|
update();
|
|
|
|
bool
|
|
insert();
|
|
|
|
bool
|
|
remove();
|
|
|
|
Json::Value
|
|
to_json();
|
|
|
|
static void
|
|
free_list(device_dbo **devices_list);
|
|
|
|
static device_dbo**
|
|
get_by_simple(const char *key, const void *value, intptr_t bind_func);
|
|
|
|
static device_dbo**
|
|
get_all();
|
|
};
|
|
|
|
|
|
#endif //EMGAUWA_CORE_DEVICE_DBO_H
|