NoJobEngine 2.0.7
Loading...
Searching...
No Matches
Project.cpp
Go to the documentation of this file.
2#include <fstream>
3#include <iomanip>
4namespace NoJob
5{
6 bool Project::Save(const ProjectConfig& c,const std::filesystem::path& p){std::ofstream o(p);if(!o)return false;o<<"NOJOB_PROJECT 1\n"<<std::quoted(c.Name)<<'\n'<<std::quoted(c.AssetDirectory.generic_string())<<'\n'<<std::quoted(c.StartScene.generic_string())<<'\n';return true;}
7 bool Project::Load(ProjectConfig& c,const std::filesystem::path& p){std::ifstream i(p);if(!i)return false;std::string h,a,s;if(!std::getline(i,h)||h.rfind("NOJOB_PROJECT",0)!=0)return false;i>>std::quoted(c.Name)>>std::quoted(a)>>std::quoted(s);c.AssetDirectory=a;c.StartScene=s;return true;}
8}
Project declarations for the Asset Management subsystem.
static bool Save(const ProjectConfig &, const std::filesystem::path &)
Definition Project.cpp:6
static bool Load(ProjectConfig &, const std::filesystem::path &)
Definition Project.cpp:7
std::filesystem::path StartScene
Definition Project.h:15
std::filesystem::path AssetDirectory
Definition Project.h:14
std::string Name
Definition Project.h:13