33 lines
517 B
C++
33 lines
517 B
C++
#ifndef DATABASE_H
|
|
#define DATABASE_H
|
|
|
|
#include <stdio.h>
|
|
#include <fstream>
|
|
#include <list>
|
|
#include <wx/wxsqlite3.h>
|
|
#include <wx/wx.h>
|
|
#include <sha1.h>
|
|
|
|
#include "model.h"
|
|
|
|
#define BDD_FILE "kc.bdd"
|
|
#define INIT_SCRIPT "init.sql"
|
|
|
|
class Database
|
|
{
|
|
public:
|
|
Database();
|
|
|
|
std::list<wxString> GetUsers();
|
|
bool IsValidUser(wxString user, wxString password);
|
|
|
|
User* LoadUser(wxString name);
|
|
void LoadYear(User* user, int year);
|
|
private:
|
|
wxSQLite3Database _db;
|
|
|
|
void CreateDatabase();
|
|
};
|
|
|
|
#endif
|