2019-07-12 19:05:56 +00:00
|
|
|
#ifndef EMGAUWA_CORE_SCHEDULE_DBO_H
|
|
|
|
#define EMGAUWA_CORE_SCHEDULE_DBO_H
|
|
|
|
|
2019-07-19 09:41:39 +00:00
|
|
|
#include <string>
|
|
|
|
#include <sqlite3.h>
|
|
|
|
#include <json/value.h>
|
|
|
|
#include "period.h"
|
|
|
|
#include "period_list.h"
|
2019-07-12 19:05:56 +00:00
|
|
|
|
|
|
|
class schedule_dbo
|
|
|
|
{
|
2019-07-19 09:41:39 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
char id[33];
|
|
|
|
char name[128];
|
|
|
|
period_list *periods;
|
|
|
|
|
|
|
|
bool
|
|
|
|
update();
|
|
|
|
|
|
|
|
bool
|
|
|
|
insert();
|
|
|
|
|
|
|
|
bool
|
|
|
|
remove();
|
|
|
|
|
2019-07-19 12:42:36 +00:00
|
|
|
~schedule_dbo();
|
|
|
|
|
2019-07-19 09:41:39 +00:00
|
|
|
Json::Value
|
|
|
|
to_json();
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_list(schedule_dbo **schedules_list);
|
|
|
|
|
|
|
|
static schedule_dbo*
|
|
|
|
get_one_by(const char *key, const char *value);
|
2019-07-12 19:05:56 +00:00
|
|
|
|
2019-07-19 09:41:39 +00:00
|
|
|
static schedule_dbo**
|
|
|
|
get_all();
|
2019-07-12 19:05:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //EMGAUWA_CORE_SCHEDULE_DBO_H
|