HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Storage.h
Go to the documentation of this file.
1 /*******************************************************************/
7 #ifndef _Storage_H__
8 #define _Storage_H__
9 
10 #include <vector>
11 #include <algorithm>
12 
13 #include "Date.h"
14 #include "KeyValue.h"
26 class HK_Storage{
27  private:
28  vector<string> HK_StoreName;
29  vector<int> HK_StoreID;
30  vector<HK_Date> HK_StoreDate;
31  vector<string> HK_StoreText;
32  vector<int> HK_StoreNumber;
33  public:
34  HK_Storage();
35 
36  void Add(string Name, int ID, HK_Date Date, string Text, int Number);
37  void Add(string Name, int ID, HK_Date Date, string Text);
38  void Add(string Name, int ID, string Text, int Number);
39  void Add(string Name, int ID, string Text);
40  void Add(string Name, int ID, int Number);
41  void Add(string Name, int ID, HK_Date Date);
42 
43  void Clear();
44 
45  int GetCount();
46  HK_Date GetDate(int Select);
47  int GetDay(int Select);
48  int GetID(int Select);
49  int GetMonth(int Select);
50  string GetName(int Select);
51  int GetNumber(int Select);
52  string GetText(int Select);
53  int GetValidID();
54  int GetYear(int Select);
55 
56  bool IsValidName(string Name);
57 
58  HK_KeyValue Search(string Prefix, string Value);
59  void SetDate(int Select, HK_Date Date);
60  void SetDay(int Select, int Days);
61  void SetID(int Select, int ID);
62  void SetMonth(int Select, int Month);
63  void SetName(int Select, string Name);
64  void SetNumber(int Select, int Number);
65  void SetText(int Select, string Text);
66  void SetYear(int Select, int Year);
67 };
68 
69 #endif
Declares HK_KeyValue And Derivative Classes.
A Class For Managing Dates.
Definition: Date.h:25
A Key and Value Type Storage.
Definition: KeyValue.h:25
A Class For Storing Values.
Definition: Storage.h:26
bool IsValidName(string Name)
Returns True If Name Isn't Already In Use.
Definition: HK_Storage.cpp:128
int GetDay(int Select)
Returns The Selected Day From The Stored Date.
Definition: HK_Storage.cpp:76
vector< int > HK_StoreNumber
Definition: Storage.h:32
vector< int > HK_StoreID
Definition: Storage.h:29
int GetMonth(int Select)
Returns The Selected Month From The Stored Date.
Definition: HK_Storage.cpp:81
HK_Date GetDate(int Select)
Returns The Selected Stored Date.
Definition: HK_Storage.cpp:71
vector< string > HK_StoreText
Definition: Storage.h:31
int GetValidID()
Returns A Valid ID For Adding Entries To The Database.
Definition: HK_Storage.cpp:106
int GetCount()
Returns The Number Of Elements Stored.
Definition: HK_Storage.cpp:101
void SetMonth(int Select, int Month)
Sets The Selected Month From The Stored Date.
Definition: HK_Storage.cpp:192
int GetNumber(int Select)
Returns The Selected Stored Number.
Definition: HK_Storage.cpp:96
void SetNumber(int Select, int Number)
Sets The Selected Stored Number.
Definition: HK_Storage.cpp:207
HK_KeyValue Search(string Prefix, string Value)
Returned HK_KeyValue's Key Holds Name And Value Holds String Where Match Was Found.
Definition: HK_Storage.cpp:138
void SetName(int Select, string Name)
Sets The Selected Stored Name.
Definition: HK_Storage.cpp:172
void SetID(int Select, int ID)
Sets The Selected Stored ID.
Definition: HK_Storage.cpp:177
HK_Storage()
Constructor.
Definition: HK_Storage.cpp:12
vector< HK_Date > HK_StoreDate
Definition: Storage.h:30
void SetDay(int Select, int Days)
Sets The Selected Day From The Stored Date.
Definition: HK_Storage.cpp:187
vector< string > HK_StoreName
Definition: Storage.h:28
void SetDate(int Select, HK_Date Date)
Sets The Selected Stored Date.
Definition: HK_Storage.cpp:182
string GetName(int Select)
Returns The Selected Stored Name.
Definition: HK_Storage.cpp:61
int GetYear(int Select)
Returns The Selected Year From The Stored Date.
Definition: HK_Storage.cpp:86
string GetText(int Select)
Returns The Selected Stored Text.
Definition: HK_Storage.cpp:91
void Add(string Name, int ID, HK_Date Date, string Text, int Number)
Adds An Item To Storage.
Definition: HK_Storage.cpp:15
void SetYear(int Select, int Year)
Sets The Selected Year From The Stored Date.
Definition: HK_Storage.cpp:197
int GetID(int Select)
Returns The Selected Stored ID.
Definition: HK_Storage.cpp:66
void Clear()
Clears All Data And Shrinks The Arrays.
Definition: HK_Storage.cpp:212
void SetText(int Select, string Text)
Sets The Selected Stored Text.
Definition: HK_Storage.cpp:202