Older/Server/Database/Database.h
amass ec6a5b8fca
All checks were successful
Deploy / PullDocker (push) Successful in 8s
Deploy / Build (push) Successful in 1m27s
add homebox code.
2024-07-10 14:37:40 +00:00

33 lines
784 B
C++

#ifndef __DATABASE_H__
#define __DATABASE_H__
#include "HomeBox.h"
#include "Singleton.h"
#include "Task.h"
#include <string>
struct sqlite3;
class Database {
friend class Amass::Singleton<Database>;
public:
~Database();
bool open(const std::string &path);
Tasks tasks();
bool addTask(uint64_t createTime, const std::string &content, const std::string &comment = "", int parentId = -1,
bool finished = false);
bool removeTask(int id);
void setTaskFinished(int id, bool finished, uint64_t finishedTime);
HomeBox::Items homeBoxItems();
bool addHomeBoxItem(const std::string &name, const std::string &location, int cost);
protected:
void initialize();
private:
sqlite3 *m_sqlite3 = nullptr;
};
#endif // __DATABASE_H__