-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,48 @@ | ||
#include <sqlite3.h> | ||
|
||
#ifndef DATABASE_H | ||
#define DATABASE_H | ||
|
||
namespace database | ||
{ | ||
void initializeDatabase(const char *file); | ||
} | ||
/** | ||
* @brief Class containing a SQLite database connection | ||
* | ||
*/ | ||
class Database | ||
{ | ||
public: | ||
/** | ||
* @brief Construct a new Database object | ||
* | ||
* @param file_path | ||
*/ | ||
Database(const std::string &file_path); | ||
/** | ||
* @brief | ||
* | ||
* @param command | ||
*/ | ||
void execute(const std::string &command); | ||
/** | ||
* @brief | ||
* | ||
*/ | ||
void printTable(const std::string &table); | ||
/** | ||
* @brief | ||
* | ||
*/ | ||
void close(); | ||
/** | ||
* @brief Destroy the Database object | ||
* | ||
*/ | ||
~Database(); | ||
|
||
private: | ||
sqlite3 *db; | ||
bool is_closed; | ||
}; | ||
} | ||
#endif // DATABASE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters