#pragma once #include #include #include #include #include #include #include #include #include namespace hex { class ProjectFile { public: struct Handler { using Function = std::function; std::fs::path basePath; Function load, store; }; struct ProviderHandler { using Function = std::function; std::fs::path basePath; Function load, store; }; static bool load(const std::fs::path &filePath); static bool store(std::optional filePath = std::nullopt); static void registerHandler(const Handler &handler) { getHandlers().push_back(handler); } static void registerPerProviderHandler(const ProviderHandler &handler) { getProviderHandlers().push_back(handler); } static std::vector& getHandlers() { return s_handlers; } static std::vector& getProviderHandlers() { return s_providerHandlers; } private: ProjectFile() = default; static std::fs::path s_currProjectPath; static std::vector s_handlers; static std::vector s_providerHandlers; }; }