conf reimpl

This commit is contained in:
Chris Punches
2017-06-09 00:46:05 -04:00
parent 3c52f94bfa
commit 7db682e503
3 changed files with 46 additions and 34 deletions

View File

@@ -2,18 +2,22 @@
Conf::Conf( std::string filename ): JSON_Loader()
{
// Conf is always loaded from file.
this->load_json_file( filename, true );
this->plan_path = this->get_key("plan_path", true, false).asString();
this->units_path = this->get_key("units_path", true, false).asString();
// always load plan_path, it is required to function.
this->get_key( this->plan_path, "plan_path", true, false );
// always load units_path, it is required to function.
this->get_key( this->units_path, "units_path", true, false );
};
std::string Conf::get_plan_path()
{
return this->plan_path;
return this->plan_path.asString();
}
std::string Conf::get_units_path()
{
return this->units_path;
return this->units_path.asString();
}