diff options
Diffstat (limited to 'core/src/Model/Project.hpp')
-rw-r--r-- | core/src/Model/Project.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/core/src/Model/Project.hpp b/core/src/Model/Project.hpp index 280eaf3..8d437ea 100644 --- a/core/src/Model/Project.hpp +++ b/core/src/Model/Project.hpp @@ -1,10 +1,11 @@ #pragma once #include "Model/Items.hpp" +#include "Model/TransactionDatabase.hpp" +#include <json/forwards.h> #include <filesystem> #include <string> -#include <json/forwards.h> class Project { public: @@ -16,15 +17,20 @@ private: std::filesystem::path mRootPath; std::string mRootPathString; std::string mName; + TransactionDatabase mDb; public: - /// Load the project from a cplt_project.json file. - static Project Load(const std::filesystem::path& projectFilePath); - /// Load the project from the directory containing the cplt_project.json file. - static Project LoadDir(const std::filesystem::path& projectPath); + /// Load the project from a directory containing the cplt_project.json file. + Project(const std::filesystem::path& rootPath); + /// Create a project with the given name in the given path. Note that the path should be a directory that will contain the project files once created. /// This function assumes the given directory will exist and is empty. - static Project Create(std::string name, const std::filesystem::path& path); + Project(std::filesystem::path rootPath, std::string name); + + Project(const Project&) = delete; + Project& operator=(const Project&) = delete; + Project(Project&&) = default; + Project& operator=(Project&&) = default; /// Path to a *directory* that contains the project file. const std::filesystem::path& GetPath() const; @@ -35,7 +41,4 @@ public: Json::Value Serialize(); void WriteToDisk(); - -private: - Project() = default; }; |