WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
233b6e32
Commit
233b6e32
authored
Dec 09, 2012
by
Thomas Egger
Browse files
Config class: One of the string parameters to findKeys is now a const reference.
parent
06ce8333
Changes
4
Hide whitespace changes
Inline
Side-by-side
meteoio/Config.cc
View file @
233b6e32
...
...
@@ -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
());
...
...
meteoio/Config.h
View file @
233b6e32
...
...
@@ -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
;
...
...
meteoio/IOUtils.cc
View file @
233b6e32
...
...
@@ -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
)
{
...
...
meteoio/meteofilters/ProcessingStack.cc
View file @
233b6e32
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment