Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
25c12869
Commit
25c12869
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[BL] minor fix
parent
806a1ce0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BaseLib/ConfigTreeNew-impl.h
+3
-2
3 additions, 2 deletions
BaseLib/ConfigTreeNew-impl.h
BaseLib/ConfigTreeNew.cpp
+10
-0
10 additions, 0 deletions
BaseLib/ConfigTreeNew.cpp
with
13 additions
and
2 deletions
BaseLib/ConfigTreeNew-impl.h
+
3
−
2
View file @
25c12869
...
...
@@ -144,10 +144,11 @@ ConfigTreeNew::
getConfAttribute
(
std
::
string
const
&
attr
)
const
{
checkUniqueAttr
(
attr
);
markVisited
<
T
>
(
attr
,
true
);
auto
&
ct
=
markVisited
<
T
>
(
attr
,
true
,
true
);
if
(
auto
attrs
=
_tree
->
get_child_optional
(
"<xmlattr>"
))
{
if
(
auto
a
=
attrs
->
get_child_optional
(
attr
))
{
++
ct
.
count
;
// count only if attribute has been found
if
(
auto
v
=
a
->
get_value_optional
<
T
>
())
{
return
*
v
;
}
else
{
...
...
@@ -156,7 +157,7 @@ getConfAttribute(std::string const& attr) const
+
"' not convertible to the desired type."
);
}
}
else
{
error
(
"
No
XML attribute name
d
\"
"
+
attr
+
"
\"
"
);
error
(
"
Did not find
XML attribute
with
name
\"
"
+
attr
+
"
\"
"
);
}
}
else
{
error
(
"This parameter has no XML attributes"
);
...
...
This diff is collapsed.
Click to expand it.
BaseLib/ConfigTreeNew.cpp
+
10
−
0
View file @
25c12869
...
...
@@ -85,6 +85,16 @@ getConfParam(std::string const& root) const
return
ct
;
}
boost
::
optional
<
ConfigTreeNew
>
ConfigTreeNew
::
getConfParamOptional
(
std
::
string
const
&
root
)
const
{
auto
ct
=
getConfSubtreeOptional
(
root
);
if
(
ct
&&
hasChildren
(
*
ct
))
error
(
"Requested parameter <"
+
root
+
"> actually is a subtree."
);
return
ct
;
}
ConfigTreeNew
ConfigTreeNew
::
getConfSubtree
(
std
::
string
const
&
root
)
const
...
...
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