HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Database.h
Go to the documentation of this file.
1 /*******************************************************************/
8 #ifndef _DATABASE_H__
9 #define _DATABASE_H__
10 
11 #include <iostream>
12 
13 #include "Batches.h"
14 #include "File.h"
15 #include "Storage.h"
16 #include "KeyValue.h"
17 #include "Info.h"
18 #include "Notifications.h"
19 #include <sqlite3.h>
20 
21 
29 class HK_Database {
30  private:
31  string HK_DBPath;
32  vector<string> HK_DBErrors;
33  vector<HK_KeyValue> TableData;
34  sqlite3 *HK_DB;
35  public:
36  HK_Database();
37  HK_Database(string Path);
38  ~HK_Database();
39 
40  bool CheckInfo();
41  bool CloseDB();
42  bool CreateDB();
43  bool CreateBackup(string Path);
44 
45  bool Execute(string SQL);
46  bool Execute(vector<string> SQL);
47 
48  vector<HK_KeyValue> GetData();
49  string GetErrors();
50 
51  bool OpenDB();
52 
53  HK_Batches ReadBatches(int Sort);
61 
62  void SetPath(string Path);
63  vector<string> SplitStrings(string In, string Split);
64 };
65 
66 #endif
Declare HK_Batches Class Methods.
Declares HK_KeyValue And Derivative Classes.
Declare HK_Notifications.
A Class For Managing Mulitple HK_Batch Objects.
Definition: Batches.h:22
A Wrapper For The Sqlite3 Database.
Definition: Database.h:29
HK_Notifications ReadNotify()
Scans Notifications Into A HK_Storage Object.
sqlite3 * HK_DB
Definition: Database.h:34
void SetPath(string Path)
Sets Path To DB.
HK_Database()
Default Constructor. You'll Need To Call SetPath()
Definition: HK_Database.cpp:12
HK_KeyValue ReadSettings()
Reads Settings Table Into HK_KeyValue Object.
vector< string > HK_DBErrors
Definition: Database.h:32
bool CloseDB()
Close The Database.
Definition: HK_Database.cpp:38
bool OpenDB()
Opens DB.
vector< HK_KeyValue > GetData()
Returns Table Data.
bool Execute(string SQL)
Executes SQL Statments.
~HK_Database()
Destructor.
Definition: HK_Database.cpp:18
HK_Storage ReadSchedules()
Reads Schedules Table Into HK_Storage Object.
vector< HK_KeyValue > TableData
Definition: Database.h:33
vector< string > SplitStrings(string In, string Split)
Splits In By Split And Returns A Vector With Data.
bool CreateBackup(string Path)
Copies HK_DBPath To Path.
HK_Storage ReadRemind()
Reads Reminders Table Into HK_Storage Object.
string HK_DBPath
Definition: Database.h:31
bool CheckInfo()
Checks Info Table In Database To See If It Matches HK_Info Data.
Definition: HK_Database.cpp:21
string GetErrors()
Returns sqlite3_errmsg(HK_DB))
HK_Storage ReadGroups()
Scans Groups Into A HK_Storage Object.
HK_Storage ReadTypes()
Reads Types Table Into HK_Storage Object.
bool CreateDB()
Populates Database With Defaults.
Definition: HK_Database.cpp:41
HK_Batches ReadBatches(int Sort)
Scans Batches Into HK_Batches Object.
HK_Storage ReadBreeds()
Scans Breeds Into A HK_Storage Object.
A Key and Value Type Storage.
Definition: KeyValue.h:25
Class For Managing Notifications In Database.
Definition: Notifications.h:22
A Class For Storing Values.
Definition: Storage.h:26