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

A Wrapper For The Sqlite3 Database. More...

#include <Database.h>

Public Member Functions

 HK_Database ()
 Default Constructor. You'll Need To Call SetPath() More...
 
 HK_Database (string Path)
 Overloaded Constructor, Sets Path. More...
 
 ~HK_Database ()
 Destructor. More...
 
bool CheckInfo ()
 Checks Info Table In Database To See If It Matches HK_Info Data. More...
 
bool CloseDB ()
 Close The Database. More...
 
bool CreateDB ()
 Populates Database With Defaults. More...
 
bool CreateBackup (string Path)
 Copies HK_DBPath To Path. More...
 
bool Execute (string SQL)
 Executes SQL Statments. More...
 
bool Execute (vector< string > SQL)
 Overloaded, Executes An Array Of SQL Statments. More...
 
vector< HK_KeyValueGetData ()
 Returns Table Data. More...
 
string GetErrors ()
 Returns sqlite3_errmsg(HK_DB)) More...
 
bool OpenDB ()
 Opens DB. More...
 
HK_Batches ReadBatches (int Sort)
 Scans Batches Into HK_Batches Object. More...
 
HK_Storage ReadBreeds ()
 Scans Breeds Into A HK_Storage Object. More...
 
HK_KeyValue ReadSettings ()
 Reads Settings Table Into HK_KeyValue Object. More...
 
HK_Storage ReadGroups ()
 Scans Groups Into A HK_Storage Object. More...
 
HK_Notifications ReadNotify ()
 Scans Notifications Into A HK_Storage Object. More...
 
HK_Storage ReadRemind ()
 Reads Reminders Table Into HK_Storage Object. More...
 
HK_Storage ReadSchedules ()
 Reads Schedules Table Into HK_Storage Object. More...
 
HK_Storage ReadTypes ()
 Reads Types Table Into HK_Storage Object. More...
 
void SetPath (string Path)
 Sets Path To DB. More...
 
vector< string > SplitStrings (string In, string Split)
 Splits In By Split And Returns A Vector With Data. More...
 

Private Attributes

string HK_DBPath
 
vector< string > HK_DBErrors
 
vector< HK_KeyValueTableData
 
sqlite3 * HK_DB
 

Detailed Description

A Wrapper For The Sqlite3 Database.

Since
03/03/2020

Definition at line 29 of file Database.h.

Constructor & Destructor Documentation

◆ HK_Database() [1/2]

HK_Database::HK_Database ( )

Default Constructor. You'll Need To Call SetPath()

Definition at line 12 of file HK_Database.cpp.

◆ HK_Database() [2/2]

HK_Database::HK_Database ( string  Path)

Overloaded Constructor, Sets Path.

Definition at line 15 of file HK_Database.cpp.

◆ ~HK_Database()

HK_Database::~HK_Database ( )

Destructor.

Definition at line 18 of file HK_Database.cpp.

Member Function Documentation

◆ CheckInfo()

bool HK_Database::CheckInfo ( )

Checks Info Table In Database To See If It Matches HK_Info Data.

Definition at line 21 of file HK_Database.cpp.

◆ CloseDB()

bool HK_Database::CloseDB ( )

Close The Database.

Definition at line 38 of file HK_Database.cpp.

◆ CreateBackup()

bool HK_Database::CreateBackup ( string  Path)

Copies HK_DBPath To Path.

Definition at line 152 of file HK_Database.cpp.

◆ CreateDB()

bool HK_Database::CreateDB ( )

Populates Database With Defaults.

Definition at line 41 of file HK_Database.cpp.

◆ Execute() [1/2]

bool HK_Database::Execute ( string  SQL)

Executes SQL Statments.

Parameters
SQLThe Statment To Be Executed. One Statement At A Time.
Returns
True On Success, Call GetErrors() If Return Is False

Definition at line 466 of file HK_Database.cpp.

◆ Execute() [2/2]

bool HK_Database::Execute ( vector< string >  SQL)

Overloaded, Executes An Array Of SQL Statments.

Parameters
SQLThe Statments To Be Executed.
Returns
True On Success, Call GetErrors() If Return Is False

Definition at line 539 of file HK_Database.cpp.

◆ GetData()

vector< HK_KeyValue > HK_Database::GetData ( )

Returns Table Data.

Definition at line 165 of file HK_Database.cpp.

◆ GetErrors()

string HK_Database::GetErrors ( )

Returns sqlite3_errmsg(HK_DB))

Definition at line 162 of file HK_Database.cpp.

◆ OpenDB()

bool HK_Database::OpenDB ( )

Opens DB.

Returns
True On Success Use GetErrors() To Get Errors

Definition at line 168 of file HK_Database.cpp.

◆ ReadBatches()

HK_Batches HK_Database::ReadBatches ( int  Sort)

Scans Batches Into HK_Batches Object.

Definition at line 174 of file HK_Database.cpp.

◆ ReadBreeds()

HK_Storage HK_Database::ReadBreeds ( )

Scans Breeds Into A HK_Storage Object.

Definition at line 312 of file HK_Database.cpp.

◆ ReadGroups()

HK_Storage HK_Database::ReadGroups ( )

Scans Groups Into A HK_Storage Object.

Definition at line 333 of file HK_Database.cpp.

◆ ReadNotify()

HK_Notifications HK_Database::ReadNotify ( )

Scans Notifications Into A HK_Storage Object.

Definition at line 353 of file HK_Database.cpp.

◆ ReadRemind()

HK_Storage HK_Database::ReadRemind ( )

Reads Reminders Table Into HK_Storage Object.

Definition at line 376 of file HK_Database.cpp.

◆ ReadSchedules()

HK_Storage HK_Database::ReadSchedules ( )

Reads Schedules Table Into HK_Storage Object.

Definition at line 399 of file HK_Database.cpp.

◆ ReadSettings()

HK_KeyValue HK_Database::ReadSettings ( )

Reads Settings Table Into HK_KeyValue Object.

Definition at line 440 of file HK_Database.cpp.

◆ ReadTypes()

HK_Storage HK_Database::ReadTypes ( )

Reads Types Table Into HK_Storage Object.

Definition at line 420 of file HK_Database.cpp.

◆ SetPath()

void HK_Database::SetPath ( string  Path)

Sets Path To DB.

Definition at line 459 of file HK_Database.cpp.

◆ SplitStrings()

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

Splits In By Split And Returns A Vector With Data.

Definition at line 550 of file HK_Database.cpp.

Member Data Documentation

◆ HK_DB

sqlite3* HK_Database::HK_DB
private

Definition at line 34 of file Database.h.

◆ HK_DBErrors

vector<string> HK_Database::HK_DBErrors
private

Definition at line 32 of file Database.h.

◆ HK_DBPath

string HK_Database::HK_DBPath
private

Definition at line 31 of file Database.h.

◆ TableData

vector<HK_KeyValue> HK_Database::TableData
private

Definition at line 33 of file Database.h.


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