HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
HK_Database.cpp
Go to the documentation of this file.
1 /*******************************************************************/
8 #include "../headers/Database.h"
9 using namespace std;
10 
13 
15 HK_Database::HK_Database(string Path){HK_DBPath = Path;}
16 
19 
22 {
23  //See If Database Contains Info Table
24  if(!Execute("SELECT * FROM Info;"))
25  return false;
26 
27  HK_Info Info;
28 
29  if( Info.GetVersion() != TableData[0].GetValue("Value") ||
30  Info.GetPlatform() != TableData[1].GetValue("Value")
31  )
32  return false;
33 
34  return true;
35 }
36 
38 bool HK_Database::CloseDB(){return sqlite3_close(HK_DB);}
39 
42 {
43  //Use HK_Date To Keep Samples Current
44  HK_Date SD,CD,LD,HD;
45  string SQL;
46 
47  CD.AddDays(10);
48  LD.AddDays(18);
49  HD.AddDays(21);
50 
51  //Batch Table
52  Execute("CREATE TABLE Batches( ID INT PRIMARY KEY, BatchName TEXT,BatchEggs INT, BatchType VARCHAR(50), BatchSDate VARCHAR(12),BatchC1Date VARCHAR(12), BatchTDate VARCHAR(12), BatchHDate VARCHAR(12),FertileEggs INT, ChicksHatched INT, BatchComments TEXT, BatchBreed TEXT,BatchGroup TEXT,Incubator VARCHAR(50),IsReminded INT, AdvEnabled INT); ");
53  //Insert A Batch
54 
55  Execute("INSERT INTO Batches VALUES(0, 'Sample Batch',6, 'Chicken', '"+SD.ToSortable("/")+"','"+CD.ToSortable("/")+"','"+LD.ToSortable("/")+"','"+HD.ToSortable("/")+"',5,4,'Sample Comment','White Rock','None','Default',0,0);");
56 
57  //Reminder Table
58  Execute("CREATE TABLE Reminders( ID INT PRIMARY KEY,RemindName VARCHAR(50),RemindDate VARCHAR(12), RemindText TEXT,IsReminded INT );");
59  Execute("INSERT INTO Reminders VALUES(0,'Sample Reminder','"+SD.ToSortable("/")+"','This Is a Sample Comment',0);");
60 
61  //Schedule Table
62  Execute("CREATE TABLE Schedules(ID INT PRIMARY KEY,SchName VARCHAR(50), SchDate varchar(12));");
63  Execute("INSERT INTO Schedules VALUES(0,'Sample Hatch Date','"+HD.ToSortable("/")+"');");
64 
65  //Types Table
66  Execute("CREATE TABLE Types(ID INT PRIMARY KEY,TypeName VARCHAR(50), TypeDays INT);");
67  Execute("INSERT INTO Types VALUES(0,'Chicken',21);");
68  Execute("INSERT INTO Types VALUES(1,'Turkey',28);");
69  Execute("INSERT INTO Types VALUES(2,'Duck',28);");
70  Execute("INSERT INTO Types VALUES(3,'Dove',14);");
71  Execute("INSERT INTO Types VALUES(4,'Pheasant',24);");
72  Execute("INSERT INTO Types VALUES(5,'Bobwhite Quail',23);");
73  Execute("INSERT INTO Types VALUES(6,'Coturnix Quail',17);");
74  Execute("INSERT INTO Types VALUES(7,'Goose',28);");
75  Execute("INSERT INTO Types VALUES(8,'Swan',35);");
76  Execute("INSERT INTO Types VALUES(9,'Ostrich',42);");
77  Execute("INSERT INTO Types VALUES(10,'Guinea Fowl',28);");
78 
79  //Breeds Table
80  Execute("CREATE TABLE Breeds(ID INT PRIMARY KEY,BreedName VARCHAR(50), BreedType VARCHAR(50), BreedDays INT);");
81  Execute("INSERT INTO Breeds VALUES(0,'White Rock','Chicken',21);");
82  Execute("INSERT INTO Breeds VALUES(1,'Rhode Island Red','Chicken',21);");
83  Execute("INSERT INTO Breeds VALUES(2,'New Hampshire','Chicken',21);");
84  Execute("INSERT INTO Breeds VALUES(3,'Black Australorp','Chicken',21);");
85  Execute("INSERT INTO Breeds VALUES(4,'Barred Rock','Chicken',21);");
86  Execute("INSERT INTO Breeds VALUES(5,'Delaware','Chicken',21);");
87  Execute("INSERT INTO Breeds VALUES(6,'Columbian Wyandotte','Chicken',21);");
88  Execute("INSERT INTO Breeds VALUES(7,'Buckeye','Chicken',21);");
89  Execute("INSERT INTO Breeds VALUES(8,'Dominique','Chicken',21);");
90  Execute("INSERT INTO Breeds VALUES(9,'Black Jersey Giant','Chicken',21);");
91  Execute("INSERT INTO Breeds VALUES(10,'White Jersey Giant','Chicken',21);");
92  Execute("INSERT INTO Breeds VALUES(11,'Buff Orpington','Chicken',21);");
93  Execute("INSERT INTO Breeds VALUES(12,'Royal Palm','Turkey',28);");
94  Execute("INSERT INTO Breeds VALUES(13,'Standard Bronze','Turkey',28);");
95  Execute("INSERT INTO Breeds VALUES(14,'Blue Slate','Turkey',28);");
96  Execute("INSERT INTO Breeds VALUES(15,'Bourbon Red','Turkey',28);");
97  Execute("INSERT INTO Breeds VALUES(16,'Narragansett','Turkey',28);");
98  Execute("INSERT INTO Breeds VALUES(17,'Black Spanish','Turkey',28);");
99  Execute("INSERT INTO Breeds VALUES(18,'White African','Guinea Fowl',28);");
100  Execute("INSERT INTO Breeds VALUES(19,'Royal Purple','Guinea Fowl',28);");
101  Execute("INSERT INTO Breeds VALUES(20,'Lavendar','Guinea Fowl',28);");
102  Execute("INSERT INTO Breeds VALUES(21,'Pearl Grey','Guinea Fowl',28);");
103  Execute("INSERT INTO Breeds VALUES(22,'White Pekin','Duck',28);");
104  Execute("INSERT INTO Breeds VALUES(23,'Ruen Ducks','Duck',28);");
105  Execute("INSERT INTO Breeds VALUES(24,'White Chinese','Goose',28);");
106  Execute("INSERT INTO Breeds VALUES(25,'African Goose','Goose',28);");
107 
108  //Groups Table
109  Execute("CREATE TABLE Groups( ID INT PRIMARY KEY,GroupName VARCHAR(50),GroupComments TEXT);");
110  Execute("INSERT INTO Groups VALUES(0,'None','This Is The Default Group');");
111 
112  //Notifications Table
113  Execute("CREATE TABLE Notifications( ID INT PRIMARY KEY,NotifyName VARCHAR(50),NotifyDate VARCHAR(12), NotifyDescription TEXT, IsNotified INT);");
114 
115  // Advanced Table
116  Execute("CREATE TABLE Advanced( ID INT PRIMARY KEY, NumOfEggs INT,Unit INT, Days INT, Tag1 TEXT, Tag2 TEXT, Tag3 TEXT,Fertile TEXT,Pipped TEXT, Result TEXT, ResultDate TEXT,EggComments TEXT, DayWeight TEXT, DayComment TEXT);");
117 
118  //Settings Table
119  Execute("CREATE TABLE Settings( ID INT PRIMARY KEY, Key TEXT, Value TEXT);");
120  Execute("INSERT INTO Settings VALUES(0,'TillCandle','12');");
121  Execute("INSERT INTO Settings VALUES(1,'BeforeHatch','3');");
122  Execute("INSERT INTO Settings VALUES(2,'ShowSplash','0');");
123  Execute("INSERT INTO Settings VALUES(3,'UseGenNotify','0');");
124  Execute("INSERT INTO Settings VALUES(4,'OpenOnClick','0');");
125  Execute("INSERT INTO Settings VALUES(5,'OpenOnDismiss','1');");
126  Execute("INSERT INTO Settings VALUES(6,'BatchSortState','0');");
127  Execute("INSERT INTO Settings VALUES(7,'HideHatched','0');");
128  Execute("INSERT INTO Settings VALUES(8,'Tag1','Size,Small,Medium,Large');");
129  Execute("INSERT INTO Settings VALUES(9,'Tag2','Shape,Pointed,Round');");
130  Execute("INSERT INTO Settings VALUES(10,'Tag3','Color,Brown,Light Brown,Dark Brown,White,Green,Blue,Light,Dark');");
131  Execute("INSERT INTO Settings VALUES(11,'ColorRed','181,255,0,255,0,217,0,217,0,255,0');");
132  Execute("INSERT INTO Settings VALUES(12,'ColorGreen','170,255,0,255,0,208,0,208,0,255,0');");
133  Execute("INSERT INTO Settings VALUES(13,'ColorBlue','150,255,0,255,0,192,0,192,0,255,0');");
134  Execute("INSERT INTO Settings VALUES(14,'Incubators','Default');");
135  Execute("INSERT INTO Settings VALUES(15,'WeightUnit','0');");
136  Execute("INSERT INTO Settings VALUES(16,'CalTextSize','18');");
137  Execute("INSERT INTO Settings VALUES(17,'LanguageXML','');");
138  Execute("INSERT INTO Settings VALUES(18,'ShowDaysLeft','0');");
139  Execute("INSERT INTO Settings VALUES(19,'DateMode','0');");
140  //Info Table
141 
142  HK_Info Info;
143 
144  Execute("CREATE TABLE Info( ID INT PRIMARY KEY, Key TEXT, Value TEXT);");
145  Execute("INSERT INTO Info VALUES(0,'Version','"+ Info.GetVersion() +"');");
146  Execute("INSERT INTO Info VALUES(1,'Platform','Desktop');");
147 
148  return true;
149 }
150 
152 bool HK_Database::CreateBackup(string Path)
153 {
154  HK_File File;
155 
156  if(!File.CopyFile(HK_DBPath, Path))
157  return false;
158  return true;
159 }
160 
162 string HK_Database::GetErrors() {return sqlite3_errmsg(HK_DB);}
163 
165 vector<HK_KeyValue> HK_Database::GetData() {return TableData;}
166 
169 {
170  return sqlite3_open(HK_DBPath.c_str(), &HK_DB);
171 }
172 
175 {
176  HK_Batches HK_DBBatches;
177  string SQL;
178  switch(Sort) {
179  case 0: {
180  SQL = "SELECT * from Batches;";
181  break;
182  }
183  case 1: {
184  SQL = "SELECT * from Batches ORDER BY BatchHDate DESC;";
185  break;
186  }
187  case 2: {
188  SQL = "SELECT * from Batches ORDER BY BatchSDate DESC;";
189  break;
190  }
191  case 3: {
192  SQL = "SELECT * from Batches ORDER BY BatchType;";
193  break;
194  }
195  case 4: {
196  SQL = "SELECT * from Batches ORDER BY BatchBreed;";
197  break;
198  }
199  default: {
200  SQL = "SELECT * from Batches;";
201  break;
202  }
203  }
204 
205  if(!Execute(SQL))
206  return HK_DBBatches;
207 
208  HK_KeyValue Data;
209  for(unsigned int A = 0; A < TableData.size(); A++) {
210  Data = TableData[A];
211 
212  HK_Date Start(Data.GetValue("BatchSDate"));
213  HK_Date Candle(Data.GetValue("BatchC1Date"));
214  HK_Date Lock(Data.GetValue("BatchTDate"));
215  HK_Date Hatch(Data.GetValue("BatchHDate"));
216 
217  HK_DBBatches.Add(
218  Data.GetInt("ID"),
219  Data.GetValue("BatchName"),
220  Data.GetValue("BatchType"),
221  Data.GetValue("BatchBreed"),
222  Data.GetValue("BatchGroup"),
223  Data.GetValue("BatchComments"),
224  Data.GetValue("Incubator"),
225  Data.GetInt("BatchEggs"),
226  Data.GetInt("FertileEggs"),
227  Data.GetInt("ChicksHatched"),
228  Start,
229  Candle,
230  Lock,
231  Hatch,
232  Data.GetInt("IsReminded"),
233  Data.GetInt("AdvEnabled")
234  );
235  }
236 
237  //Scan Advanced Data As Well
238  if(!Execute("SELECT * from Advanced;"))
239  return HK_DBBatches;
240 
241  //Declare Some Temp Variables
242  vector<string> Tag1,Tag2,Tag3;
243  vector<string> Fertile,Pipped;
244  vector<string> Result,ResultDate;
245  vector<string> Comments;
246  vector<string> DayWeight, DayComment,Buffer;
247 
248  HK_Egg Egg;
249  HK_Date Date;
250  HK_Weight Weight;
251  HK_Advanced Adv;
252 
253  for(unsigned int B = 0; B < TableData.size(); B++) {
254  Data = TableData[B];
255 
256  Adv.SetID(Data.GetInt("ID"));
257  Adv.SetUnit(Data.GetInt("Unit"));
258  Adv.SetDays(Data.GetInt("Days"));
259 
260  Tag1 = SplitStrings(Data.GetValue("Tag1"),"&");
261  Tag2 = SplitStrings(Data.GetValue("Tag2"),"&");
262  Tag3 = SplitStrings(Data.GetValue("Tag3"),"&");
263  Fertile = SplitStrings(Data.GetValue("Fertile"),"/");
264  Pipped = SplitStrings(Data.GetValue("Pipped"),"/");
265  Result = SplitStrings(Data.GetValue("Result"),"/");
266  ResultDate = SplitStrings(Data.GetValue("ResultDate"),"&");
267  Comments = SplitStrings(Data.GetValue("EggComments"),"&");
268  DayWeight = SplitStrings(Data.GetValue("DayWeight"),"&");
269  DayComment = SplitStrings(Data.GetValue("DayComment"),"&");
270 
271  for(unsigned int A = 0; A < Tag1.size();A++) {
272  Egg.SetTag1(Tag1[A]);
273  Egg.SetTag2(Tag2[A]);
274  Egg.SetTag3(Tag3[A]);
275  Egg.SetFertile(stoi(Fertile[A]));
276  Egg.SetPipped(stoi(Pipped[A]));
277  Egg.SetResult(stoi(Result[A]));
278 
279  //Split Result Dates
280  Buffer = SplitStrings(ResultDate[A], "/");
281  Date.SetDate(stoi(Buffer[2]),stoi(Buffer[1]),stoi(Buffer[0]));
282  Egg.SetDate(Date);
283 
284  Egg.SetComments(Comments[A]);
285 
286  //DayWeight
287  Egg.ClearDayData();
288  Buffer = SplitStrings(DayWeight[A], "/");
289 
290  unsigned int C;
291 
292  for(C = 0; C < Buffer.size(); C++) {
293  Weight.Set(Buffer[C]);
294  Egg.AddDayWeight(Weight);
295  }
296  //DayComments
297  Buffer = SplitStrings(DayComment[A], "|");
298  for(C = 0; C < Buffer.size(); C++)
299  Egg.AddDayComments(Buffer[C]);
300  Adv.AddEgg(Egg);
301  }
302  //And Add To Batches
303  if(!HK_DBBatches.AddAdvanced(Adv))
304  cout<<"Log: No Matching Batch For Advanced Entry!"<<endl;
305 
306  Adv.Clear();
307  }
308  return HK_DBBatches;
309 }
310 
313 {
314  HK_Storage Storage;
315  HK_KeyValue Data;
316 
317  if(!Execute("SELECT * from Breeds ORDER BY BreedType;"))
318  return Storage;
319 
320  for(unsigned int A = 0; A < TableData.size(); A++) {
321  Data = TableData[A];
322  Storage.Add(
323  Data.GetValue("BreedName"),
324  Data.GetInt("ID"),
325  Data.GetValue("BreedType"),
326  Data.GetInt("BreedDays")
327  );
328  }
329  return Storage;
330 }
331 
334 {
335  HK_Storage Storage;
336  HK_KeyValue Data;
337 
338  if(!Execute("SELECT * from Groups;"))
339  return Storage;
340 
341  for(unsigned int A = 0; A < TableData.size(); A++) {
342  Data = TableData[A];
343  Storage.Add(
344  Data.GetValue("GroupName"),
345  Data.GetInt("ID"),
346  Data.GetValue("GroupComments")
347  );
348  }
349  return Storage;
350 }
351 
354 {
355  HK_Notifications Storage;
356  HK_KeyValue Data;
357 
358  if(!Execute("SELECT * from Notifications ORDER BY NotifyDate DESC;"))
359  return Storage;
360 
361  for(unsigned int A = 0; A < TableData.size(); A++) {
362  Data = TableData[A];
363  HK_Date Date(Data.GetValue("NotifyDate"));
364  Storage.Add(
365  Data.GetValue("NotifyName"),
366  Data.GetInt("ID"),
367  Date,
368  Data.GetValue("NotifyDescription"),
369  Data.GetInt("IsNotified")
370  );
371  }
372  return Storage;
373 }
374 
377 {
378  HK_Storage Storage;
379  HK_KeyValue Data;
380 
381  if(!Execute("SELECT * from Reminders ORDER BY RemindDate DESC;"))
382  return Storage;
383 
384  for(unsigned int A = 0; A < TableData.size(); A++) {
385  Data = TableData[A];
386  HK_Date Date(Data.GetValue("RemindDate"));
387  Storage.Add(
388  Data.GetValue("RemindName"),
389  Data.GetInt("ID"),
390  Date,
391  Data.GetValue("RemindText"),
392  Data.GetInt("IsReminded")
393  );
394  }
395  return Storage;
396 }
397 
400 {
401  HK_Storage Storage;
402  HK_KeyValue Data;
403 
404  if(!Execute("SELECT * from Schedules ORDER BY SchDate DESC;"))
405  return Storage;
406 
407  for(unsigned int A = 0; A < TableData.size(); A++) {
408  Data = TableData[A];
409  HK_Date Date(Data.GetValue("SchDate"));
410  Storage.Add(
411  Data.GetValue("SchName"),
412  Data.GetInt("ID"),
413  Date
414  );
415  }
416  return Storage;
417 }
418 
421 {
422  HK_Storage Storage;
423  HK_KeyValue Data;
424 
425  if(!Execute("SELECT * from Types ORDER BY ID;"))
426  return Storage;
427 
428  for(unsigned int A = 0; A < TableData.size(); A++) {
429  Data = TableData[A];
430  Storage.Add(
431  Data.GetValue("TypeName"),
432  Data.GetInt("ID"),
433  Data.GetInt("TypeDays")
434  );
435  }
436  return Storage;
437 }
438 
441 {
442  HK_KeyValue Storage;
443  HK_KeyValue Data;
444 
445  if(!Execute("SELECT * from Settings ORDER BY ID;"))
446  return Storage;
447 
448  for(unsigned int A = 0; A < TableData.size(); A++) {
449  Data = TableData[A];
450  Storage.Add(
451  Data.GetValue("Key"),
452  Data.GetValue("Value")
453  );
454  }
455  return Storage;
456 }
457 
459 void HK_Database::SetPath(string Path){HK_DBPath = Path;}
460 
466 bool HK_Database::Execute(string SQL)
467 {
468  //Check For Empty Statment
469  if(SQL.empty())
470  return true;
471 
472  if(OpenDB()) {
473  fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(HK_DB));
474  return false;
475  }
476 
477  sqlite3_stmt *Stmt = NULL;
478  int Result = sqlite3_prepare_v2(HK_DB,SQL.c_str(),-1,&Stmt,NULL);
479 
480  if(Result != SQLITE_OK)
481  return false;
482 
483  int Rows = 0, Columns = 0, Selected = 0, Type;
484  HK_KeyValue RowData;
485 
486  //Reset TableData
487  TableData.clear();
488 
489  Result = sqlite3_step(Stmt);
490  while (Result != SQLITE_DONE && Result != SQLITE_OK) {
491  Rows++;
492  Columns = sqlite3_column_count(Stmt);
493 
494  for (Selected = 0; Selected < Columns; Selected++) {
495  Type = sqlite3_column_type(Stmt, Selected);
496  const char * ColumnName = sqlite3_column_name(Stmt, Selected);
497 
498  if (Type == SQLITE_INTEGER) {
499  RowData.Add(
500  ColumnName,
501  to_string(sqlite3_column_int(Stmt, Selected))
502  );
503  }
504  else if (Type == SQLITE_FLOAT) {
505  RowData.Add(
506  ColumnName,
507  to_string(sqlite3_column_double(Stmt, Selected))
508  );
509  }
510  else if (Type == SQLITE_TEXT) {
511  RowData.Add(
512  ColumnName,
513  (const char *) (sqlite3_column_text(Stmt, Selected))
514  );
515  }
516  else
517  printf("Not Matching Int Float Or Text");
518  }
519 
520  TableData.push_back(RowData);
521  RowData.Clear();
522  Result = sqlite3_step(Stmt);
523  }
524 
525  Result = sqlite3_finalize(Stmt);
526  if(Result != SQLITE_OK)
527  return false;
528 
529  CloseDB();
530 
531  return true;
532 }
533 
539 bool HK_Database::Execute(vector<string> SQL)
540 {
541  for(unsigned int A = 0; A < SQL.size(); A++) {
542  if(!Execute(SQL[A]))
543  return false;
544  }
545  return true;
546 }
547 
548 
550 vector<string> HK_Database::SplitStrings(string In, string Split)
551 {
552  vector<string> OutArray;
553  string Hold;
554 
555  for(unsigned int a = 0; a < In.length(); a++) {
556  if(In[a] == Split[0]) {
557  OutArray.push_back(Hold);
558  Hold.clear();
559  continue;
560  }
561  Hold.push_back(In[a]);
562  }
563  OutArray.push_back(Hold);
564  return OutArray;
565 }
HK_Info Info
Definition: Declare.h:34
A Class For Managing Multiple HK_Egg Instances.
Definition: Advanced.h:20
void AddEgg(HK_Egg Egg)
Adds An HK_Egg To HK_AdvEggs Vector.
Definition: HK_Advanced.cpp:40
void SetID(int ID)
Sets ID.
void Clear()
Clears All Data From This Object.
Definition: HK_Advanced.cpp:28
void SetUnit(int Unit)
Sets Weight Unit Used.
void SetDays(int Days)
Sets Incubation Days.
A Class For Managing Mulitple HK_Batch Objects.
Definition: Batches.h:22
void Add(HK_Batch Batch)
Adds Another HK_Batch.
Definition: HK_Batches.cpp:15
bool AddAdvanced(HK_Advanced Adv)
Add Advanced Data To The Batch That Has A Matching ID.
Definition: HK_Batches.cpp:38
HK_Notifications ReadNotify()
Scans Notifications Into A HK_Storage Object.
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.
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< 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.
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 Class For Managing Dates.
Definition: Date.h:25
std::string ToSortable(std::string Separator)
Generate A Sortable String For Database.
Definition: HK_Date.cpp:163
bool AddDays(int Days)
Adds Days To This HK_Date.
Definition: HK_Date.cpp:70
bool SetDate(int Days, int Month, int Year)
Sets Day, Month, and Year.
Definition: HK_Date.cpp:32
A Class For Storing And Retieving Data For One Egg.
Definition: Egg.h:24
void SetDate(HK_Date Date)
Sets Result Date.
Definition: HK_Egg.cpp:149
void SetComments(string Comments)
Sets Egg Comments.
Definition: HK_Egg.cpp:151
void SetResult(int Result)
Sets Result Status.
Definition: HK_Egg.cpp:147
void SetTag3(string Tag)
Sets The Third Tag.
Definition: HK_Egg.cpp:141
void SetTag1(string Tag)
Sets The First Tag.
Definition: HK_Egg.cpp:137
void SetFertile(int Fertile)
Sets Fertile Status.
Definition: HK_Egg.cpp:143
void ClearDayData()
Clears And Shrinks The Day Data Arrays.
Definition: HK_Egg.cpp:15
void AddDayWeight(HK_Weight Weight)
Adds Weight For Another Day.
Definition: HK_Egg.cpp:155
void AddDayComments(string Comments)
Adds Comments For Another Day.
Definition: HK_Egg.cpp:159
void SetPipped(int Pipped)
Sets Pip Status.
Definition: HK_Egg.cpp:145
void SetTag2(string Tag)
Sets The Second Tag.
Definition: HK_Egg.cpp:139
Simple Platform Independent File Management Functions.
Definition: File.h:26
bool CopyFile(string Original, string Target)
A Simple C Function To Copy File From Original To Target.
Definition: HK_File.cpp:23
Version And Other Information For HatchKeeper.
Definition: Info.h:22
std::string GetVersion()
Returns The Version Of HatchKeeper.
Definition: HK_Info.cpp:15
std::string GetPlatform()
Returns The Platform For HatchKeeper.
Definition: HK_Info.cpp:18
A Key and Value Type Storage.
Definition: KeyValue.h:25
void Clear()
Clears All Internal Data And Shrinks The Storage.
void Add(string Key, string Value)
Adds A Key And Value;.
Definition: HK_KeyValue.cpp:33
int GetInt(int Selection)
Returns The Selected Setting Value As An Integer.
Definition: HK_KeyValue.cpp:49
string GetValue(int Selection)
Returns The Selected Setting Value As A String.
Definition: HK_KeyValue.cpp:67
Class For Managing Notifications In Database.
Definition: Notifications.h:22
A Class For Storing Values.
Definition: Storage.h:26
void Add(string Name, int ID, HK_Date Date, string Text, int Number)
Adds An Item To Storage.
Definition: HK_Storage.cpp:15
A Class For Managing Data For One Weight.
Definition: Weight.h:24
void Set(float Weight)
Sets The Weight Value Using A Float.
Definition: HK_Weight.cpp:52