1#include "../../include/utils/config_parser.h"
8 std::string ext = boost::filesystem::extension(file);
11 boost::property_tree::read_json(file,
tree);
12 }
else if (ext ==
".info"){
14 boost::property_tree::read_info(file,
tree);
17 std::string errMsg = ext +
": unsupported file extension (supported: .json, .info)";
18 BOOST_THROW_EXCEPTION(std::invalid_argument(errMsg));
29 std::list <ConfigParser> lst_;
30 BOOST_FOREACH(
const boost::property_tree::ptree::value_type &val,
tree.get_child(key))
32 if(val.second.empty()){
33 std::cerr <<
"List does not contain objects. Please use 'getList<T>(const std::string &key)'instead."
34 <<
" - Returning empty list." << std::endl;
Config parser class for reading input parameter/settings.
ConfigParser getObj(const std::string &key)
boost::property_tree::ptree tree
boost property tree instance
std::list< ConfigParser > getObjList(const std::string &key)