HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
HK_KeyValue Class Reference

A Key and Value Type Storage. More...

#include <KeyValue.h>

Public Member Functions

 HK_KeyValue ()
 Constructor. More...
 
void Add (string Key, string Value)
 Adds A Key And Value;. More...
 
void Add (HK_KeyValue KeyValue)
 Overloaded Adds Another HK_KeyValue To This One. More...
 
int CheckSelection (int Selection)
 Checks Selection And Returns An Error If Out Of Bounds. More...
 
void Clear ()
 Clears All Internal Data And Shrinks The Storage. More...
 
int FindSelection (string Key)
 Finds Selection By Matching The Input To A Key. More...
 
int GetCount ()
 Return The Amount Of Setting Keys Stored. More...
 
vector< string > GetArray (int Selection)
 Returns The Selected Value As An Array Of Strings. More...
 
vector< string > GetArray (string Key)
 Returns The Value As An Array Of Strings For A Key Matching The Input. More...
 
int GetInt (int Selection)
 Returns The Selected Setting Value As An Integer. More...
 
int GetInt (string Key)
 Returns A Setting Value As An Integer, For A Key Matching The Input. More...
 
vector< int > GetIntArray (int Selection)
 Returns The Selected Value As An Array Of Integers. More...
 
vector< int > GetIntArray (string Key)
 Returns The Value As An Array Of Integers For A Key Matching The Input. More...
 
string GetKey (int Selection)
 Returns The Selected Key As A String. More...
 
vector< string > GetUpdate (string TableName)
 Returns An SQL Statement Updating All Settings Marked Dirty. Marks All Clean. More...
 
string GetValue (int Selection)
 Returns The Selected Setting Value As A String. More...
 
string GetValue (string Key)
 Returns A Setting Value As A String, For A Key Matching The Input. More...
 
bool IsDirty (int Selection)
 Returns True If Selected Setting Is Dirty. More...
 
bool IsDirty (string Key)
 Returns True If Selected Setting Is Dirty. More...
 
HK_KeyValue Search (string Value)
 Returns A HK_KeyValue Object With Matches To Value. More...
 
void SetClean (int Selection)
 Clears The Dirty Status For The Selected Setting. More...
 
void SetClean (string Key)
 Overloaded, Uses A Key Instead Of Integer Selection. More...
 
void SetError ()
 Pushes An Error To The The End Of Vectors For A Return Value If Nothing Is Found. More...
 
void SetDirty (int Selection)
 
void SetDirty (string Key)
 Overloaded, Uses A Key Instead Of Integer Selection. More...
 
void SetValue (int Selection, string Value)
 Sets Value For Selection. Sets Dirty As Well. More...
 
void SetValue (string Key, string Value)
 OverLoaded, Uses Key Instead Of Integer Selection. More...
 
vector< string > SplitStrings (string In, string Split)
 Converts A String Into An Array. More...
 

Private Attributes

vector< string > HK_SettingKey
 
vector< string > HK_SettingValue
 
vector< bool > HK_Update
 

Detailed Description

A Key and Value Type Storage.

Since
01/25/2020

Definition at line 25 of file KeyValue.h.

Constructor & Destructor Documentation

◆ HK_KeyValue()

HK_KeyValue::HK_KeyValue ( )

Constructor.

Definition at line 13 of file HK_KeyValue.cpp.

Member Function Documentation

◆ Add() [1/2]

void HK_KeyValue::Add ( HK_KeyValue  KeyValue)

Overloaded Adds Another HK_KeyValue To This One.

Definition at line 42 of file HK_KeyValue.cpp.

◆ Add() [2/2]

void HK_KeyValue::Add ( string  Key,
string  Value 
)

Adds A Key And Value;.

Definition at line 33 of file HK_KeyValue.cpp.

◆ CheckSelection()

int HK_KeyValue::CheckSelection ( int  Selection)

Checks Selection And Returns An Error If Out Of Bounds.

Definition at line 16 of file HK_KeyValue.cpp.

◆ Clear()

void HK_KeyValue::Clear ( )

Clears All Internal Data And Shrinks The Storage.

Definition at line 211 of file HK_KeyValue.cpp.

◆ FindSelection()

int HK_KeyValue::FindSelection ( string  Key)

Finds Selection By Matching The Input To A Key.

Definition at line 178 of file HK_KeyValue.cpp.

◆ GetArray() [1/2]

vector< string > HK_KeyValue::GetArray ( int  Selection)

Returns The Selected Value As An Array Of Strings.

Definition at line 140 of file HK_KeyValue.cpp.

◆ GetArray() [2/2]

vector< string > HK_KeyValue::GetArray ( string  Key)

Returns The Value As An Array Of Strings For A Key Matching The Input.

Definition at line 145 of file HK_KeyValue.cpp.

◆ GetCount()

int HK_KeyValue::GetCount ( )

Return The Amount Of Setting Keys Stored.

Definition at line 26 of file HK_KeyValue.cpp.

◆ GetInt() [1/2]

int HK_KeyValue::GetInt ( int  Selection)

Returns The Selected Setting Value As An Integer.

Definition at line 49 of file HK_KeyValue.cpp.

◆ GetInt() [2/2]

int HK_KeyValue::GetInt ( string  Key)

Returns A Setting Value As An Integer, For A Key Matching The Input.

Definition at line 55 of file HK_KeyValue.cpp.

◆ GetIntArray() [1/2]

vector< int > HK_KeyValue::GetIntArray ( int  Selection)

Returns The Selected Value As An Array Of Integers.

Definition at line 150 of file HK_KeyValue.cpp.

◆ GetIntArray() [2/2]

vector< int > HK_KeyValue::GetIntArray ( string  Key)

Returns The Value As An Array Of Integers For A Key Matching The Input.

Definition at line 164 of file HK_KeyValue.cpp.

◆ GetKey()

string HK_KeyValue::GetKey ( int  Selection)

Returns The Selected Key As A String.

Definition at line 61 of file HK_KeyValue.cpp.

◆ GetUpdate()

vector< string > HK_KeyValue::GetUpdate ( string  TableName)

Returns An SQL Statement Updating All Settings Marked Dirty. Marks All Clean.

Definition at line 222 of file HK_KeyValue.cpp.

◆ GetValue() [1/2]

string HK_KeyValue::GetValue ( int  Selection)

Returns The Selected Setting Value As A String.

Definition at line 67 of file HK_KeyValue.cpp.

◆ GetValue() [2/2]

string HK_KeyValue::GetValue ( string  Key)

Returns A Setting Value As A String, For A Key Matching The Input.

Definition at line 73 of file HK_KeyValue.cpp.

◆ IsDirty() [1/2]

bool HK_KeyValue::IsDirty ( int  Selection)

Returns True If Selected Setting Is Dirty.

Definition at line 79 of file HK_KeyValue.cpp.

◆ IsDirty() [2/2]

bool HK_KeyValue::IsDirty ( string  Key)

Returns True If Selected Setting Is Dirty.

Definition at line 81 of file HK_KeyValue.cpp.

◆ Search()

HK_KeyValue HK_KeyValue::Search ( string  Value)

Returns A HK_KeyValue Object With Matches To Value.

Definition at line 84 of file HK_KeyValue.cpp.

◆ SetClean() [1/2]

void HK_KeyValue::SetClean ( int  Selection)

Clears The Dirty Status For The Selected Setting.

See also
SetDirty() GetSQL()

Definition at line 103 of file HK_KeyValue.cpp.

◆ SetClean() [2/2]

void HK_KeyValue::SetClean ( string  Key)

Overloaded, Uses A Key Instead Of Integer Selection.

Definition at line 105 of file HK_KeyValue.cpp.

◆ SetDirty() [1/2]

void HK_KeyValue::SetDirty ( int  Selection)

Sets HK_Update To True For The Selected Setting.

This Function Gets Called Automatically When SetValue() Is Called. Calling GetSQL() Will Mark All As Clean, Or You Can Manually Call SetClean() To Veto A Setting Change.

See also
SetClean() GetSQL()

Definition at line 115 of file HK_KeyValue.cpp.

◆ SetDirty() [2/2]

void HK_KeyValue::SetDirty ( string  Key)

Overloaded, Uses A Key Instead Of Integer Selection.

Definition at line 117 of file HK_KeyValue.cpp.

◆ SetError()

void HK_KeyValue::SetError ( )

Pushes An Error To The The End Of Vectors For A Return Value If Nothing Is Found.

Definition at line 120 of file HK_KeyValue.cpp.

◆ SetValue() [1/2]

void HK_KeyValue::SetValue ( int  Selection,
string  Value 
)

Sets Value For Selection. Sets Dirty As Well.

See also
SetDirty()

Definition at line 128 of file HK_KeyValue.cpp.

◆ SetValue() [2/2]

void HK_KeyValue::SetValue ( string  Key,
string  Value 
)

OverLoaded, Uses Key Instead Of Integer Selection.

Definition at line 134 of file HK_KeyValue.cpp.

◆ SplitStrings()

vector< string > HK_KeyValue::SplitStrings ( string  In,
string  Split 
)

Converts A String Into An Array.

Parameters
InThe String To Be Split
SplitThe Value To Split The String At
Returns
A vector<string>

Definition at line 193 of file HK_KeyValue.cpp.

Member Data Documentation

◆ HK_SettingKey

vector<string> HK_KeyValue::HK_SettingKey
private

Definition at line 27 of file KeyValue.h.

◆ HK_SettingValue

vector<string> HK_KeyValue::HK_SettingValue
private

Definition at line 28 of file KeyValue.h.

◆ HK_Update

vector<bool> HK_KeyValue::HK_Update
private

Definition at line 29 of file KeyValue.h.


The documentation for this class was generated from the following files: