conf reimpl
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
class Conf: public JSON_Loader
|
||||
{
|
||||
private:
|
||||
std::string plan_path;
|
||||
std::string units_path;
|
||||
Json::Value plan_path;
|
||||
Json::Value units_path;
|
||||
|
||||
public:
|
||||
Conf( std::string filename );
|
||||
|
||||
Reference in New Issue
Block a user