WSL/SLF GitLab Repository

Commit 62343d78 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

My previous commit was terrible... it simply made it impossible to define...

My previous commit was terrible... it simply made it impossible to define optional keys. This has now been fixed but required a change in the API. So, don't use Config::nothrow but IOUtils::nothrow instead.
parent cdd370e1
......@@ -184,15 +184,15 @@ void BufferedIOHandler::setDfltBufferProperties()
{
double chunk_size_days = 15.; //default chunk size value
chunks = 1;
cfg.getValue("BUFF_CHUNK_SIZE", "General", chunk_size_days, Config::nothrow); //in days
cfg.getValue("BUFF_CHUNKS", "General", chunks, Config::nothrow);
cfg.getValue("BUFF_CHUNK_SIZE", "General", chunk_size_days, IOUtils::nothrow); //in days
cfg.getValue("BUFF_CHUNKS", "General", chunks, IOUtils::nothrow);
chunk_size = Duration(chunk_size_days, 0);
//get buffer centering options
double buff_centering = -1.;
double buff_start = -1.;
cfg.getValue("BUFF_CENTERING", "General", buff_centering, Config::nothrow);
cfg.getValue("BUFF_BEFORE", "General", buff_start, Config::nothrow);
cfg.getValue("BUFF_CENTERING", "General", buff_centering, IOUtils::nothrow);
cfg.getValue("BUFF_BEFORE", "General", buff_start, IOUtils::nothrow);
if ((buff_centering != -1.) && (buff_start != -1.))
throw InvalidArgumentException("Please do NOT provide both BUFF_CENTERING and BUFF_BEFORE!!", AT);
......@@ -215,7 +215,7 @@ void BufferedIOHandler::setDfltBufferProperties()
//-> we end up not reading enough data and rebuffering...
max_grids = 10; //default number of grids to keep in buffer
cfg.getValue("BUFF_GRIDS", "General", max_grids, Config::nothrow);
cfg.getValue("BUFF_GRIDS", "General", max_grids, IOUtils::nothrow);
}
void BufferedIOHandler::setMinBufferRequirements(const double& i_chunk_size, const double& i_buff_before)
......
......@@ -34,12 +34,12 @@ Config::Config(const std::string& i_filename) : properties(), sourcename(i_filen
addFile(i_filename);
}
ConfigProxy Config::get(const std::string& key, const Options& opt) const
ConfigProxy Config::get(const std::string& key, const IOUtils::ThrowOptions& opt) const
{
return ConfigProxy(*this, key, Config::defaultSection, opt);
}
ConfigProxy Config::get(const std::string& key, const std::string& section, const Options& opt) const
ConfigProxy Config::get(const std::string& key, const std::string& section, const IOUtils::ThrowOptions& opt) const
{
return ConfigProxy(*this, key, section, opt);
}
......@@ -63,18 +63,14 @@ void Config::addKey(const std::string& key, const std::string& value)
addKey(key, section, value);
}
void Config::addKey(std::string key, std::string section, const std::string& value)
void Config::addKey(const std::string& key, const std::string& section, const std::string& value)
{
IOUtils::toUpper(key);
IOUtils::toUpper(section);
properties[section + "::" + key] = value;
properties[ IOUtils::strToUpper(section) + "::" + IOUtils::strToUpper(key) ] = value;
}
void Config::deleteKey(std::string key, std::string section)
void Config::deleteKey(const std::string& key, const std::string& section)
{
IOUtils::toUpper(key);
IOUtils::toUpper(section);
properties.erase(section + "::" + key);
properties.erase( IOUtils::strToUpper(section) + "::" + IOUtils::strToUpper(key) );
}
bool Config::keyExists(const std::string& key, const std::string& section) const
......
......@@ -58,8 +58,6 @@ class Config : POPBase {
class Config {
#endif
public:
enum Options { dothrow, nothrow };
/**
* @brief Empty constructor. The user MUST later one fill the internal key/value map object
*/
......@@ -104,7 +102,7 @@ class Config {
* @param[in] key string representing the key to be added
* @param[in] section std::string representing a section name; the key has to be part of this section
*/
void deleteKey(std::string key, std::string section=Config::defaultSection);
void deleteKey(const std::string& key, const std::string& section=Config::defaultSection);
/**
* @brief Add a specific key/value pair to the internal key/value map object.
......@@ -113,7 +111,7 @@ class Config {
* @param[in] section std::string representing a section name; the key has to be part of this section
* @param[in] value string representing the matching value to be added
*/
void addKey(std::string key, std::string section, const std::string& value);
void addKey(const std::string& key, const std::string& section, const std::string& value);
/**
* @brief Returns the filename that the Config object was constructed with.
......@@ -135,7 +133,7 @@ class Config {
*/
friend std::ostream& operator<<(std::ostream& os, const Config& cfg);
template <typename T> std::vector<T> getValue(const std::string& key, const Options& opt=Config::dothrow) const
template <typename T> std::vector<T> getValue(const std::string& key, const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
std::vector<T> tmp;
getValue(key, Config::defaultSection, tmp, opt);
......@@ -143,7 +141,7 @@ class Config {
}
template <typename T> std::vector<T> getValue(const std::string& key, const std::string& section,
const Options& opt=Config::dothrow) const
const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
std::vector<T> tmp;
getValue(key, section, tmp, opt);
......@@ -162,7 +160,7 @@ class Config {
*/
template <typename T> void getValue(const std::string& key,
std::vector<T>& vecT,
const Options& opt=Config::dothrow) const
const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
getValue(key, "GENERAL", vecT, opt);
}
......@@ -179,17 +177,16 @@ class Config {
* @param[in] opt indicating whether an exception should be raised, when key is not present
*/
template <typename T> void getValue(const std::string& key, const std::string& section,
std::vector<T>& vecT, const Options& opt=Config::dothrow) const
std::vector<T>& vecT, const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
vecT.clear();
const std::string new_key( IOUtils::strToUpper(key) );
const std::string new_section( IOUtils::strToUpper(section) );
try {
vecT.clear();
const std::string new_key( IOUtils::strToUpper(key) );
const std::string new_section( IOUtils::strToUpper(section) );
IOUtils::getValueForKey<T>(properties, new_section + "::" + new_key, vecT, opt);
} catch(const std::exception& e){
std::stringstream ss;
ss << "[E] Error for Config of " << sourcename << ": " << e.what();
throw UnknownValueException(ss.str(), AT);
throw UnknownValueException("[E] Error in "+sourcename+": no value for key "+new_section+"::"+new_key, AT);
}
}
......@@ -199,7 +196,7 @@ class Config {
* @param[in] opt indicating whether an exception should be raised, when key is not present
* @return A value of type T
*/
ConfigProxy get(const std::string& key, const Options& opt=Config::dothrow) const;
ConfigProxy get(const std::string& key, const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const;
/**
* @ brief A function that allows to retrieve a value for a key as return parameter (vectors of values too)
......@@ -211,11 +208,11 @@ class Config {
* Example Usage:
* @code
* Config cfg("io.ini");
* vector<int> = cfg.get("DEPTHS", "INPUT", Config::nothrow);
* vector<int> = cfg.get("DEPTHS", "INPUT", IOUtils::nothrow);
* string mystr = cfg.get("PATH", "OUTPUT");
* @endcode
*/
ConfigProxy get(const std::string& key, const std::string& section, const Options& opt=Config::dothrow) const;
ConfigProxy get(const std::string& key, const std::string& section, const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const;
/**
* @brief Template function to retrieve a value of class T for a certain key
......@@ -223,7 +220,7 @@ class Config {
* @param[out] t a variable of class T into which the value for the corresponding key is saved (e.g. double, int, std::string)
* @param[in] opt indicating whether an exception should be raised, when key is not present
*/
template <typename T> void getValue(const std::string& key, T& t, const Options& opt=Config::dothrow) const
template <typename T> void getValue(const std::string& key, T& t, const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
getValue(key, "GENERAL", t, opt);
}
......@@ -236,16 +233,15 @@ class Config {
* @param[in] opt indicating whether an exception should be raised, when key is not present
*/
template <typename T> void getValue(const std::string& key, const std::string& section, T& t,
const Options& opt=Config::dothrow) const
const IOUtils::ThrowOptions& opt=IOUtils::dothrow) const
{
const std::string new_key( IOUtils::strToUpper(key) );
const std::string new_section( IOUtils::strToUpper(section) );
try {
const std::string new_key( IOUtils::strToUpper(key) );
const std::string new_section( IOUtils::strToUpper(section) );
IOUtils::getValueForKey<T>(properties, new_section + "::" + new_key, t, opt);
} catch(const std::exception& e){
std::stringstream ss;
ss << "[E] Error for Config of " << sourcename << ": " << e.what();
throw UnknownValueException(ss.str(), AT);
throw UnknownValueException("[E] Error in "+sourcename+": no value for key "+new_section+"::"+new_key, AT);
}
}
......@@ -282,10 +278,10 @@ class ConfigProxy {
const Config& proxycfg;
const std::string& key;
const std::string& section;
const Config::Options& opt;
const IOUtils::ThrowOptions& opt;
ConfigProxy(const Config& i_cfg, const std::string& i_key,
const std::string& i_section, const Config::Options& i_opt)
const std::string& i_section, const IOUtils::ThrowOptions& i_opt)
: proxycfg(i_cfg), key(i_key),section(i_section), opt(i_opt) { }
template<typename T> operator T() {
......
......@@ -333,18 +333,15 @@ void readDirectory(const std::string& path, std::list<std::string>& dirlist, con
std::string getLogName() {
char *tmp;
const size_t len=64;
char logname[len]; //to keep the user name short enough
if((tmp=getenv("USERNAME"))==NULL) { //Windows & Unix
if((tmp=getenv("LOGNAME"))==NULL) { //Unix
tmp=getenv("USER"); //Windows & Unix
}
}
if(tmp==NULL) return std::string("N/A");
strncpy(logname, tmp, len-1);
return std::string(logname);
if(tmp==NULL) return std::string("N/A");
return std::string(tmp);
}
void readKeyValueHeader(std::map<std::string,std::string>& headermap,
......@@ -675,14 +672,14 @@ template<> bool convertString<Coords>(Coords& t, const std::string& str, std::io
void getProjectionParameters(const Config& cfg, std::string& coordin, std::string& coordinparam,
std::string& coordout, std::string& coordoutparam) {
cfg.getValue("COORDSYS", "Input", coordin);
cfg.getValue("COORDPARAM", "Input", coordinparam, Config::nothrow);
cfg.getValue("COORDSYS", "Output", coordout, Config::nothrow);
cfg.getValue("COORDPARAM", "Output", coordoutparam, Config::nothrow);
cfg.getValue("COORDPARAM", "Input", coordinparam, IOUtils::nothrow);
cfg.getValue("COORDSYS", "Output", coordout, IOUtils::nothrow);
cfg.getValue("COORDPARAM", "Output", coordoutparam, IOUtils::nothrow);
}
void getTimeZoneParameters(const Config& cfg, double& tz_in, double& tz_out) {
cfg.getValue("TIME_ZONE", "Input", tz_in, Config::nothrow);
cfg.getValue("TIME_ZONE", "Output", tz_out, Config::nothrow);
cfg.getValue("TIME_ZONE", "Input", tz_in, IOUtils::nothrow);
cfg.getValue("TIME_ZONE", "Output", tz_out, IOUtils::nothrow);
}
size_t seek(const Date& soughtdate, const std::vector<MeteoData>& vecM, const bool& exactmatch)
......
......@@ -67,8 +67,7 @@ class Config;
std::string getLibVersion();
namespace IOUtils {
const unsigned int nothrow = 0;
const unsigned int dothrow = 1;
enum ThrowOptions { dothrow, nothrow };
const double nodata = -999.0; ///<This is the internal nodata value
//const double not_set = std::numeric_limits<double>::max()-2.;
const unsigned int unodata = (unsigned int)-1;
......@@ -126,7 +125,7 @@ namespace IOUtils {
* @param dirlist list of mathcing file names
* @param pattern optional pattern that must be part of the file names
*/
void readDirectory(const std::string& path, std::list<std::string>& dirlist, const std::string& pattern = "");
void readDirectory(const std::string& path, std::list<std::string>& dirlist, const std::string& pattern="");
bool validFileName(const std::string& filename);
......@@ -254,13 +253,10 @@ namespace IOUtils {
* @param[in] options Extra options, by default IOUtils::dothrow
*/
template <class T> void getValueForKey(const std::map<std::string,std::string>& properties,
const std::string& key, T& t, const unsigned int& options=IOUtils::dothrow){
const std::string& key, T& t, const ThrowOptions& options=IOUtils::dothrow){
if (key.empty() && options!=IOUtils::nothrow)
throw InvalidArgumentException("Empty key", AT);
//const std::string value = (const_cast<std::map<std::string,std::string>&>(properties))[key];
//if (value == ""){} //The alternative way
const std::map<std::string, std::string>::const_iterator it = properties.find(key);
if (it == properties.end()){
......@@ -286,7 +282,7 @@ namespace IOUtils {
* @param[in] options Extra options, by default IOUtils::dothrow
*/
template <class T> void getValueForKey(const std::map<std::string,std::string>& properties,
const std::string& key, std::vector<T>& vecT, const unsigned int& options=IOUtils::dothrow)
const std::string& key, std::vector<T>& vecT, const ThrowOptions& options=IOUtils::dothrow)
{
if (key.empty() && options!=IOUtils::nothrow)
throw InvalidArgumentException("Empty key", AT);
......
......@@ -42,8 +42,8 @@ Meteo1DInterpolator::Meteo1DInterpolator(const Config& in_cfg)
taskargs.push_back(vecResamplingArguments);
}
cfg.getValue("WINDOW_SIZE", "Interpolations1D", window_size, Config::nothrow);
window_size /= 86400; //user uses seconds, internally julian day is used
cfg.getValue("WINDOW_SIZE", "Interpolations1D", window_size, IOUtils::nothrow);
window_size /= 86400.; //user uses seconds, internally julian day is used
if (window_size <= 0.01)
throw IOException("WINDOW_SIZE not valid", AT);
}
......@@ -59,12 +59,10 @@ void Meteo1DInterpolator::getWindowSize(ProcessingProperties& o_properties) cons
bool Meteo1DInterpolator::resampleData(const Date& date, const std::vector<MeteoData>& vecM, MeteoData& md)
{
const size_t vecM_size = vecM.size();
if (vecM_size == 0) //Deal with case of the empty vector
if (vecM.empty()) //Deal with case of the empty vector
return false; //nothing left to do
md = vecM[0]; //create a clone of one of the elements
md = vecM.front(); //create a clone of one of the elements
md.reset(); //set all values to IOUtils::nodata
md.setDate(date);
......@@ -74,12 +72,12 @@ bool Meteo1DInterpolator::resampleData(const Date& date, const std::vector<Meteo
//Three cases
ResamplingAlgorithms::ResamplingPosition elementpos = ResamplingAlgorithms::exact_match;
if (index == IOUtils::npos) { //nothing found append new element at the left or right
if (vecM.at(0).date > date) {
if (vecM.front().date > date) {
elementpos = ResamplingAlgorithms::begin;
index = 0;
} else if (vecM.at(vecM_size-1).date < date) {
} else if (vecM.back().date < date) {
elementpos = ResamplingAlgorithms::end;
index = vecM_size - 1;
index = vecM.size() - 1;
}
md.setResampled(true);
} else if ((index != IOUtils::npos) && (vecM[index].date != date)) {
......@@ -90,14 +88,13 @@ bool Meteo1DInterpolator::resampleData(const Date& date, const std::vector<Meteo
}
size_t ii = 0;
for (ii=0; ii<tasklist.size(); ii++){ //For all meteo parameters
for (; ii<tasklist.size(); ii++){ //For all meteo parameters
if (tasklist[ii] != "no") //resampling can be disabled by stating e.g. TA::resample = no
ResamplingAlgorithms::getAlgorithm(tasklist[ii])(index, elementpos, ii, taskargs[ii], window_size, vecM, md);
}
//There might be more parameters, interpolate them too
const MeteoData& origmd = vecM.at(0); //this element must exist at this point
const MeteoData& origmd = vecM.front(); //this element must exist at this point
for ( ; ii < origmd.getNrOfParameters(); ii++){
const string parametername = origmd.getNameForParameter(ii);
......@@ -127,25 +124,25 @@ string Meteo1DInterpolator::getInterpolationForParameter(const std::string& parn
* arguments for that specific algorithm.
*/
vecArguments.clear();
cfg.getValue(parname+"::args", "Interpolations1D", vecArguments, Config::nothrow);
cfg.getValue(parname+"::args", "Interpolations1D", vecArguments, IOUtils::nothrow);
std::string tmp;
cfg.getValue(parname+"::resample", "Interpolations1D", tmp, Config::nothrow);
cfg.getValue(parname+"::resample", "Interpolations1D", tmp, IOUtils::nothrow);
if (tmp.length() > 0)
if (!tmp.empty())
return tmp;
return "linear"; //the default resampling is linear
}
Meteo1DInterpolator& Meteo1DInterpolator::operator=(const Meteo1DInterpolator& source) {
Meteo1DInterpolator& Meteo1DInterpolator::operator=(const Meteo1DInterpolator& source) {
if(this != &source) {
window_size = source.window_size;
tasklist = source.tasklist;
taskargs = source.taskargs;
extended_tasklist = source.extended_tasklist;
}
return *this;
extended_tasklist = source.extended_tasklist;
}
return *this;
}
std::ostream& operator<<(std::ostream& os, const Meteo1DInterpolator& Interpolator) {
......
......@@ -96,15 +96,15 @@ void Meteo2DInterpolator::interpolate(const Date& date, const DEMObject& dem, co
throw IOException("No IOManager reference has been set!", AT);
//Show algorithms to be used for this parameter
map<string, vector<string> >::const_iterator it = mapAlgorithms.find(MeteoData::getParameterName(meteoparam));
const map<string, vector<string> >::const_iterator it = mapAlgorithms.find(MeteoData::getParameterName(meteoparam));
if (it != mapAlgorithms.end()){
double maxQualityRating = 0.0;
auto_ptr<InterpolationAlgorithm> bestalgorithm(NULL);
vector<string> vecArgs;
for (size_t ii=0; ii < it->second.size(); ii++){
const string& algoname = it->second.at(ii);
vector<string> vecArgs;
getArgumentsForAlgorithm(meteoparam, algoname, vecArgs);
//Get the configured algorithm
......@@ -166,7 +166,7 @@ size_t Meteo2DInterpolator::getAlgorithmsForParameter(const std::string& parname
return 0;
cfg.getValue(vecKeys.at(0), "Interpolations2D", vecAlgorithms, Config::nothrow);
cfg.getValue(vecKeys.at(0), "Interpolations2D", vecAlgorithms, IOUtils::nothrow);
return vecAlgorithms.size();
}
......@@ -177,28 +177,26 @@ size_t Meteo2DInterpolator::getArgumentsForAlgorithm(const MeteoData::Parameters
{
vecArgs.clear();
const string keyname = MeteoData::getParameterName(param) +"::"+ algorithm;
cfg.getValue(keyname, "Interpolations2D", vecArgs, Config::nothrow);
cfg.getValue(keyname, "Interpolations2D", vecArgs, IOUtils::nothrow);
return vecArgs.size();
}
void Meteo2DInterpolator::checkMinMax(const double& minval, const double& maxval, Grid2DObject& gridobj)
{
unsigned int nx=0, ny=0;
gridobj.grid2D.size(nx, ny);
for (unsigned int jj=0; jj<ny; jj++){
for (unsigned int ii=0; ii<nx; ii++){
double& value = gridobj.grid2D(ii,jj);
if (value == IOUtils::nodata){
continue;
}
if (value < minval) {
value = minval;
} else if (value > maxval) {
value = maxval;
}
const unsigned int nx = gridobj.getNx();
const unsigned int ny = gridobj.getNy();
const unsigned int nxy = nx*ny;
for (unsigned int ii=0; ii<nxy; ii++){
double& value = gridobj.grid2D(ii);
if (value == IOUtils::nodata){
continue;
}
if (value < minval) {
value = minval;
} else if (value > maxval) {
value = maxval;
}
}
}
......
......@@ -78,7 +78,7 @@ size_t ProcessingStack::getFiltersForParameter(const Config& cfg, const std::str
for (size_t ii=0; ii<vecKeys.size(); ii++){
std::string tmp;
cfg.getValue(vecKeys[ii], "Filters", tmp, Config::nothrow);
cfg.getValue(vecKeys[ii], "Filters", tmp, IOUtils::nothrow);
vecFilters.push_back(tmp);
}
......@@ -89,7 +89,7 @@ size_t ProcessingStack::getArgumentsForFilter(const Config& cfg, const std::stri
std::vector<std::string>& vecArguments)
{
// Retrieve the values for a given 'keyname' and store them in a vector calles 'vecArguments'
cfg.getValue(keyname, "Filters", vecArguments, Config::nothrow);
cfg.getValue(keyname, "Filters", vecArguments, IOUtils::nothrow);
return vecArguments.size();
}
......@@ -97,13 +97,12 @@ void ProcessingStack::process(const std::vector< std::vector<MeteoData> >& ivec,
std::vector< std::vector<MeteoData> >& ovec, const bool& second_pass)
{
ovec.clear();
ovec.reserve(ivec.size());
ovec.insert(ovec.begin(), ivec.size(), vector<MeteoData>());
for (size_t ii=0; ii<ivec.size(); ii++){ //for every station
if (!ivec[ii].empty()){
//pick one element and check whether the param_name parameter exists
const size_t param = ivec[ii][0].getParameterIndex(param_name);
const size_t param = ivec[ii].front().getParameterIndex(param_name);
if (param != IOUtils::npos){
std::vector<MeteoData> tmp = ivec[ii];
......
......@@ -107,9 +107,9 @@ ARCIO::ARCIO(const std::string& configfile)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
a3d_view_in = false;
cfg.getValue("A3D_VIEW", "Input", a3d_view_in, Config::nothrow);
cfg.getValue("A3D_VIEW", "Input", a3d_view_in, IOUtils::nothrow);
a3d_view_out = false;
cfg.getValue("A3D_VIEW", "Output", a3d_view_out, Config::nothrow);
cfg.getValue("A3D_VIEW", "Output", a3d_view_out, IOUtils::nothrow);
getGridPaths();
}
......@@ -121,28 +121,28 @@ ARCIO::ARCIO(const Config& cfgreader)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
a3d_view_in = false;
cfg.getValue("A3D_VIEW", "Input", a3d_view_in, Config::nothrow);
cfg.getValue("A3D_VIEW", "Input", a3d_view_in, IOUtils::nothrow);
a3d_view_out = false;
cfg.getValue("A3D_VIEW", "Output", a3d_view_out, Config::nothrow);
cfg.getValue("A3D_VIEW", "Output", a3d_view_out, IOUtils::nothrow);
getGridPaths();
}
void ARCIO::getGridPaths() {
grid2dpath_in.clear(), grid2dpath_out.clear();
string tmp;
cfg.getValue("GRID2D", "Input", tmp, Config::nothrow);
cfg.getValue("GRID2D", "Input", tmp, IOUtils::nothrow);
if (tmp == "ARC") //keep it synchronized with IOHandler.cc for plugin mapping!!
cfg.getValue("GRID2DPATH", "Input", grid2dpath_in);
tmp.clear();
cfg.getValue("GRID2D", "Output", tmp, Config::nothrow);
cfg.getValue("GRID2D", "Output", tmp, IOUtils::nothrow);
if (tmp == "ARC") //keep it synchronized with IOHandler.cc for plugin mapping!!
cfg.getValue("GRID2DPATH", "Output", grid2dpath_out);
grid2d_ext_in = ".asc";
cfg.getValue("GRID2DEXT", "Input", grid2d_ext_in, Config::nothrow);
cfg.getValue("GRID2DEXT", "Input", grid2d_ext_in, IOUtils::nothrow);
if(grid2d_ext_in=="none") grid2d_ext_in.clear();
grid2d_ext_out = ".asc";
cfg.getValue("GRID2DEXT", "Output", grid2d_ext_out, Config::nothrow);
cfg.getValue("GRID2DEXT", "Output", grid2d_ext_out, IOUtils::nothrow);
if(grid2d_ext_out=="none") grid2d_ext_out.clear();
}
......
......@@ -93,16 +93,16 @@ ARPSIO& ARPSIO::operator=(const ARPSIO& source) {
void ARPSIO::setOptions()
{
string tmp;
cfg.getValue("GRID2D", "Input", tmp, Config::nothrow);
cfg.getValue("GRID2D", "Input", tmp, IOUtils::nothrow);
if (tmp == "ARPS") { //keep it synchronized with IOHandler.cc for plugin mapping!!
cfg.getValue("GRID2DPATH", "Input", grid2dpath_in);
}
cfg.getValue("ARPS_XCOORD", "Input", xcoord, Config::dothrow);
cfg.getValue("ARPS_YCOORD", "Input", ycoord, Config::dothrow);
cfg.getValue("ARPS_XCOORD", "Input", xcoord, IOUtils::dothrow);
cfg.getValue("ARPS_YCOORD", "Input", ycoord, IOUtils::dothrow);
//default value has been set in constructor
cfg.getValue("GRID2DEXT", "Input", ext, Config::nothrow);
cfg.getValue("GRID2DEXT", "Input", ext, IOUtils::nothrow);
if(ext=="none") ext.clear();
}
......
......@@ -54,14 +54,14 @@ BormaIO::BormaIO(const std::string& configfile) : cfg(configfile)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = default_tz;
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,IOUtils::nothrow);
}
BormaIO::BormaIO(const Config& cfgreader) : cfg(cfgreader)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = default_tz;
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,IOUtils::nothrow);
}
BormaIO::~BormaIO() throw()
......@@ -153,7 +153,7 @@ void BormaIO::readStationNames()
stationname.clear();
ss << "STATION" << counter;
cfg.getValue(ss.str(), "Input", stationname, Config::nothrow);
cfg.getValue(ss.str(), "Input", stationname, IOUtils::nothrow);
if (!stationname.empty()){
vecStationName.push_back(stationname);
......
......@@ -149,17 +149,17 @@ void GRIBIO::setOptions()
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
string tmp;
cfg.getValue("GRID2D", "Input", tmp, Config::nothrow);
cfg.getValue("GRID2D", "Input", tmp, IOUtils::nothrow);