Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
bc1aa7a4
Commit
bc1aa7a4
authored
15 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
reverting patch 5929. As it turns out, the std::map::at() method is *not* standard conforming
[[Imported from SVN: r5931]]
parent
c66f7aee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/configparser.cc
+4
-17
4 additions, 17 deletions
dune/common/configparser.cc
dune/common/configparser.hh
+2
-10
2 additions, 10 deletions
dune/common/configparser.hh
with
6 additions
and
27 deletions
dune/common/configparser.cc
+
4
−
17
View file @
bc1aa7a4
...
...
@@ -137,7 +137,7 @@ void ConfigParser::report(const string prefix) const
}
}
bool
ConfigParser
::
hasKey
(
const
string
&
key
)
const
bool
ConfigParser
::
hasKey
(
const
string
&
key
)
{
string
::
size_type
dot
=
key
.
find
(
"."
);
...
...
@@ -147,14 +147,14 @@ bool ConfigParser::hasKey(const string& key) const
if
(
subs
.
count
(
prefix
)
==
0
)
return
false
;
const
ConfigParser
&
s
=
sub
(
prefix
);
ConfigParser
&
s
=
sub
(
prefix
);
return
s
.
hasKey
(
key
.
substr
(
dot
+
1
));
}
else
return
(
values
.
count
(
key
)
!=
0
);
}
bool
ConfigParser
::
hasSub
(
const
string
&
key
)
const
bool
ConfigParser
::
hasSub
(
const
string
&
key
)
{
string
::
size_type
dot
=
key
.
find
(
"."
);
...
...
@@ -164,7 +164,7 @@ bool ConfigParser::hasSub(const string& key) const
if
(
subs
.
count
(
prefix
)
==
0
)
return
false
;
const
ConfigParser
&
s
=
sub
(
prefix
);
ConfigParser
&
s
=
sub
(
prefix
);
return
s
.
hasSub
(
key
.
substr
(
dot
+
1
));
}
else
...
...
@@ -184,19 +184,6 @@ ConfigParser& ConfigParser::sub(const string& key)
return
subs
[
key
];
}
const
ConfigParser
&
ConfigParser
::
sub
(
const
string
&
key
)
const
{
string
::
size_type
dot
=
key
.
find
(
"."
);
if
(
dot
!=
string
::
npos
)
{
const
ConfigParser
&
s
=
sub
(
key
.
substr
(
0
,
dot
));
return
s
.
sub
(
key
.
substr
(
dot
+
1
));
}
else
return
subs
.
at
(
key
);
}
string
&
ConfigParser
::
operator
[]
(
const
string
&
key
)
{
string
::
size_type
dot
=
key
.
find
(
"."
);
...
...
This diff is collapsed.
Click to expand it.
dune/common/configparser.hh
+
2
−
10
View file @
bc1aa7a4
...
...
@@ -94,7 +94,7 @@ namespace Dune {
* \param key key name
* \return true if key exists in structure, otherwise false
*/
bool
hasKey
(
const
std
::
string
&
key
)
const
;
bool
hasKey
(
const
std
::
string
&
key
);
/** \brief test for substructure
...
...
@@ -104,7 +104,7 @@ namespace Dune {
* \param sub substructure name
* \return true if substructure exists in structure, otherwise false
*/
bool
hasSub
(
const
std
::
string
&
sub
)
const
;
bool
hasSub
(
const
std
::
string
&
sub
);
/** \brief get value reference for key
...
...
@@ -140,14 +140,6 @@ namespace Dune {
ConfigParser
&
sub
(
const
std
::
string
&
sub
);
/** \brief get const substructure by name
*
* \param sub substructure name
* \return reference to substructure
*/
const
ConfigParser
&
sub
(
const
std
::
string
&
sub
)
const
;
/** \brief get value as string
*
* Returns pure string value for given key.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment