WSL/SLF GitLab Repository

Commit 233b6e32 authored by Thomas Egger's avatar Thomas Egger
Browse files

Config class: One of the string parameters to findKeys is now a const reference.

parent 06ce8333
......@@ -167,7 +167,7 @@ std::string Config::getSourceName() const
return sourcename;
}
size_t Config::findKeys(std::vector<std::string>& vecResult, const std::string keystart,
size_t Config::findKeys(std::vector<std::string>& vecResult, const std::string& keystart,
std::string section) const
{
vecResult.clear();
......@@ -176,7 +176,6 @@ size_t Config::findKeys(std::vector<std::string>& vecResult, const std::string k
section = defaultSection;
const string tmp_keystart = IOUtils::strToUpper(section) + "::" + IOUtils::strToUpper(keystart);
//Loop through keys, look for substring match - push it into vecResult
for (map<string,string>::const_iterator it=properties.begin(); it != properties.end(); it++){
const string tmp = (it->first).substr(0, tmp_keystart.length());
......
......@@ -263,7 +263,7 @@ class Config {
* @endcode
*/
size_t findKeys(std::vector<std::string>& vecResult,
const std::string keystart, std::string section="GENERAL") const;
const std::string& keystart, std::string section="GENERAL") const;
static const std::string defaultSection;
......
......@@ -173,11 +173,11 @@ void trim(std::string& str)
}
void toUpper(std::string& str) {
std::transform(str.begin(), str.end(),str.begin(), ::toupper);
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
}
void toLower(std::string& str) {
std::transform(str.begin(), str.end(),str.begin(), ::tolower);
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
}
std::string strToUpper(const std::string &str) {
......
......@@ -77,7 +77,7 @@ size_t ProcessingStack::getFiltersForParameter(const Config& cfg, const std::str
std::string tmp;
cfg.findKeys(vecKeys, parname+"::filter", "Filters");
for (size_t ii=0; ii<vecKeys.size(); ii++){
for (size_t ii=0; ii<vecKeys.size(); ii++){
cfg.getValue(vecKeys[ii], "Filters", tmp, Config::nothrow);
vecFilters.push_back(tmp);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment