util/config.cc
/// Read configuration parameters for rsked per m_config_path
/// and setup working parameters.
///
Read configuration parameters for rsked per m_config_path
and setup working parameters.
Read configuration parameters for rsked per m_config_path and setup working parameters .
void Config::read_config()
{
    if (not fs::exists(m_config_path)) {
        LOG_ERROR(Lgr)
            << "Config no such file: " << m_config_path;
        throw Config_file_error();
    }
    try {
        fs::ifstream sfile(m_config_path);
        sfile >> m_croot;       
    }
    catch (std::exception &e) {
        LOG_ERROR(Lgr) << "Config error reading from "
                       << m_config_path << ": " << e.what();
        throw Config_file_error();
    }
    m_file_writetime = last_write_time(m_config_path);
    const Json::Value &sch=m_croot["schema"];
    if (not sch.isNull()) {
        m_schema = sch.asString();
    } else {
        m_schema = "unknown";
    }
}
void Config :: read_config ( ) { if ( not fs :: exists ( m_config_path ) ) { LOG_ERROR ( Lgr ) << " " << m_config_path ; throw Config_file_error ( ) ; } try { fs :: ifstream sfile ( m_config_path ) ; sfile >> m_croot ; } catch ( std :: exception & e ) { LOG_ERROR ( Lgr ) << " " << m_config_path << " " << e . what ( ) ; throw Config_file_error ( ) ; } m_file_writetime = last_write_time ( m_config_path ) ; const Json :: Value & sch = m_croot [ " " ] ; if ( not sch . isNull ( ) ) { m_schema = sch . asString ( ) ; } else { m_schema = " " ; } }
Read configuration parameters for rsked per m_config_path
and setup working parameters.
Read configuration parameters for rsked per m_config_path and setup working parameters .
// n.b. may throw a Json::RuntimeError //