#pragma once #include #include #include #include #include #include #include #include #include "dependency.h" #include "loggger.h" class Project { public: enum class State { unknown, read, discovering, error }; Project(const std::filesystem::path& location, const std::filesystem::path& destination); ~Project(); bool read(); void discover(); State getStatus() const; std::string getName() const; uint32_t dependenciesCount() const; static void log(Logger::Severity severity, const std::string& message); static void debug(const std::string& message); static void info(const std::string& message); static void minor(const std::string& message); static void major(const std::string& message); static void warn(const std::string& message); static void error(const std::string& message); static void fatal(const std::string& message); static void printLog(); private: void parse(const nlohmann::json& json); void createDepencencyFromString(const std::string& entry); void createDepencencyFromObject(const nlohmann::json& entry); private: std::filesystem::path location; std::filesystem::path destination; State state; std::string name; std::map dependencies; const bool root; static Logger* logger; };