NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
Project.cpp
Go to the documentation of this file.
1
#include "
Engine/Assets/Project.h
"
2
#include <fstream>
3
#include <iomanip>
4
namespace
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.h
Project declarations for the Asset Management subsystem.
NoJob::Project::Save
static bool Save(const ProjectConfig &, const std::filesystem::path &)
Definition
Project.cpp:6
NoJob::Project::Load
static bool Load(ProjectConfig &, const std::filesystem::path &)
Definition
Project.cpp:7
NoJob
Definition
BTActionNode.h:13
NoJob::ProjectConfig
Definition
Project.h:12
NoJob::ProjectConfig::StartScene
std::filesystem::path StartScene
Definition
Project.h:15
NoJob::ProjectConfig::AssetDirectory
std::filesystem::path AssetDirectory
Definition
Project.h:14
NoJob::ProjectConfig::Name
std::string Name
Definition
Project.h:13
Engine
Assets
Project.cpp
Generated by
1.18.0