#include #include #include #include #include #include #include namespace hex { std::vector ProjectFile::s_handlers; std::vector ProjectFile::s_providerHandlers; std::fs::path ProjectFile::s_currProjectPath; std::function ProjectFile::s_loadProjectFunction; std::function, bool)> ProjectFile::s_storeProjectFunction; void ProjectFile::setProjectFunctions( const std::function &loadFun, const std::function, bool)> &storeFun ) { ProjectFile::s_loadProjectFunction = loadFun; ProjectFile::s_storeProjectFunction = storeFun; } bool ProjectFile::load(const std::fs::path &filePath) { return s_loadProjectFunction(filePath); } bool ProjectFile::store(std::optional filePath, bool updateLocation) { return s_storeProjectFunction(filePath, updateLocation); } bool ProjectFile::hasPath() { return !ProjectFile::s_currProjectPath.empty(); } void ProjectFile::clearPath() { ProjectFile::s_currProjectPath.clear(); } std::fs::path ProjectFile::getPath() { return ProjectFile::s_currProjectPath; } void ProjectFile::setPath(const std::fs::path &path) { ProjectFile::s_currProjectPath = path; } }