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
274673f7
Commit
274673f7
authored
3 years ago
by
Lars Bilke
Committed by
Dmitri Naumov
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
clang-format ConfigTreeUtil.h
parent
8bbd72e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
BaseLib/ConfigTreeUtil.h
+30
-23
30 additions, 23 deletions
BaseLib/ConfigTreeUtil.h
with
30 additions
and
23 deletions
BaseLib/ConfigTreeUtil.h
+
30
−
23
View file @
274673f7
...
...
@@ -14,20 +14,20 @@
namespace
BaseLib
{
/*! Manages a ConfigTree and the <tt>boost::property_tree</tt> it depends on.
*
* The whole purpose of this class is making the management of said dependency easy.
* The whole purpose of this class is making the management of said dependency
* easy.
*/
class
ConfigTreeTopLevel
final
{
public:
/*! Construct a new instance from the given data.
*
* \param filepath stored for use in error/warning messages
* \param be_ruthless if true, then warnings will raise errors, .i.e. lead
to program abortion,
* else warnings will only warn
* \param ptree the underlying ptree of the created ConfigTree
* \param filepath
stored for use in error/warning messages
* \param be_ruthless if true, then warnings will raise errors, .i.e. lead
*
to program abortion,
else warnings will only warn
* \param ptree
the underlying ptree of the created ConfigTree
*/
explicit
ConfigTreeTopLevel
(
std
::
string
const
&
filepath
,
bool
const
be_ruthless
,
...
...
@@ -53,7 +53,8 @@ public:
*
* This only checks the top level, as usual with ConfigTree instances.
*
* \post Afterwards the contained ConfigTree instance must not be used anymore!
* \post Afterwards the contained ConfigTree instance must not be used
* anymore!
*/
void
checkAndInvalidate
();
...
...
@@ -67,27 +68,33 @@ private:
*
* \param filepath see ConfigTreeTopLevel::ConfigTreeTopLevel()
* \param be_ruthless see ConfigTreeTopLevel::ConfigTreeTopLevel()
* \param toplevel_tag name of the outermost tag in the XML file. The returned ConfigTree is rooted
* one level below that tag.
* \param includepath optional path in which relative include file path will be resolved.
* \param toplevel_tag name of the outermost tag in the XML file. The returned
* ConfigTree is rooted one level below that tag.
* \param includepath optional path in which relative include file path will be
* resolved.
*
* The parameter \c toplevel_tag is provided for compatibility with our existing configuration
* files whose toplevel tags are written in camel case, which conflicts with the naming rules of
* ConfigTree. Via that parameter the naming rules do not apply to the toplevel tag.
* The parameter \c toplevel_tag is provided for compatibility with our existing
* configuration files whose toplevel tags are written in camel case, which
* conflicts with the naming rules of ConfigTree. Via that parameter the naming
* rules do not apply to the toplevel tag.
*
* Unfortunately the XML parser shipped with <tt>boost::property_tree</tt> does not fully support
* the XML standard. Additionally there might be encoding issues. From their docs:
* Unfortunately the XML parser shipped with <tt>boost::property_tree</tt> does
* not fully support the XML standard. Additionally there might be encoding
* issues. From their docs:
*
* > Please note that RapidXML does not understand the encoding specification. If you pass it a
* > character buffer, it assumes the data is already correctly encoded; if you pass it a filename,
* > it will read the file using the character conversion of the locale you give it (or the global
* > locale if you give it none). This means that, in order to parse a UTF-8-encoded XML file into
* > a wptree, you have to supply an alternate locale, either directly or by replacing the global one.
* > Please note that RapidXML does not understand the encoding specification.
* If you pass it a > character buffer, it assumes the data is already correctly
* encoded; if you pass it a filename, > it will read the file using the
* character conversion of the locale you give it (or the global > locale if you
* give it none). This means that, in order to parse a UTF-8-encoded XML file
* into > a wptree, you have to supply an alternate locale, either directly or
* by replacing the global one.
*
* \see http://www.boost.org/doc/libs/1_60_0/doc/html/property_tree/parsers.html
*/
ConfigTreeTopLevel
makeConfigTree
(
std
::
string
const
&
filepath
,
bool
const
be_ruthless
,
std
::
string
const
&
toplevel_tag
,
std
::
string
includepath
=
""
);
ConfigTreeTopLevel
makeConfigTree
(
std
::
string
const
&
filepath
,
bool
const
be_ruthless
,
std
::
string
const
&
toplevel_tag
,
std
::
string
includepath
=
""
);
}
// namespace BaseLib
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