rex/src/loaders/Conf.cpp

24 lines
565 B
C++
Raw Normal View History

2017-04-22 12:07:11 +00:00
#include "Conf.h"
Conf::Conf( std::string filename ): JSON_Loader()
2017-04-22 12:07:11 +00:00
{
2017-06-09 04:46:05 +00:00
// Conf is always loaded from file.
this->load_json_file( filename, true );
2017-06-09 04:46:05 +00:00
// 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 );
2017-04-22 12:07:11 +00:00
};
std::string Conf::get_plan_path()
{
2017-06-09 04:46:05 +00:00
return this->plan_path.asString();
2017-04-22 12:07:11 +00:00
}
std::string Conf::get_units_path()
{
2017-06-09 04:46:05 +00:00
return this->units_path.asString();
2017-04-22 12:07:11 +00:00
}