From 162bcfe04a49bfc992cdf11c88553918e4d78806 Mon Sep 17 00:00:00 2001 From: dominikpalatynski Date: Tue, 6 Feb 2024 20:39:13 +0100 Subject: [PATCH] Create Basic DataBase. Fixing DataBaseCommon.pp --- source/DataBase/DataBaseCommon.hpp | 32 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/source/DataBase/DataBaseCommon.hpp b/source/DataBase/DataBaseCommon.hpp index 8638264..65bcfe6 100644 --- a/source/DataBase/DataBaseCommon.hpp +++ b/source/DataBase/DataBaseCommon.hpp @@ -4,16 +4,28 @@ #include struct DataBaseCommon { - static constexpr std::vector userRecordsRecords{"Username", "Password"}; - static constexpr std::vector categoriesRecords{"Category"}; - static constexpr std::vector passwordHistoryRecords{"Creation_Time", "Modify_Time", "Expiry_Time"}; - static constexpr std::vector passwordRecords{ - "User_Id", "Category_Id", "Title", "Username", "Password", "Note", "Url"}; + static const std::vector userRecordsRecords; + static const std::vector categoriesRecords; + static const std::vector passwordHistoryRecords; + static const std::vector passwordRecords; - static constexpr std::string dataBasePath{"../../../source/dataBase/password-manager.db"}; + static const std::string dataBasePath; - static constexpr std::string users{"Users"}; - static constexpr std::string passwords{"Passwords"}; - static constexpr std::string passwordHistory{"PasswordHistory"}; - static constexpr std::string categories{"Categories"}; + static const std::string users; + static const std::string passwords; + static const std::string passwordHistory; + static const std::string categories; }; + +const std::vector DataBaseCommon::userRecordsRecords{"Username", "Password"}; +const std::vector DataBaseCommon::categoriesRecords{"Category"}; +const std::vector DataBaseCommon::passwordHistoryRecords{"Creation_Time", "Modify_Time", "Expiry_Time"}; +const std::vector DataBaseCommon::passwordRecords{ + "User_Id", "Category_Id", "Title", "Username", "Password", "Note", "Url"}; + +const std::string DataBaseCommon::dataBasePath{"../../../source/dataBase/password-manager.db"}; + +const std::string DataBaseCommon::users{"Users"}; +const std::string DataBaseCommon::passwords{"Passwords"}; +const std::string DataBaseCommon::passwordHistory{"PasswordHistory"}; +const std::string DataBaseCommon::categories{"Categories"}; \ No newline at end of file