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
e9a218df
Commit
e9a218df
authored
9 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[BL] Move propertyTreeToString into ConfigTree.
parent
e4de70b3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
BaseLib/ConfigTree.cpp
+10
-0
10 additions, 0 deletions
BaseLib/ConfigTree.cpp
BaseLib/ConfigTree.h
+3
-0
3 additions, 0 deletions
BaseLib/ConfigTree.h
BaseLib/StringTools.cpp
+0
-8
0 additions, 8 deletions
BaseLib/StringTools.cpp
BaseLib/StringTools.h
+0
-6
0 additions, 6 deletions
BaseLib/StringTools.h
with
13 additions
and
14 deletions
BaseLib/ConfigTree.cpp
+
10
−
0
View file @
e9a218df
...
...
@@ -11,11 +11,13 @@
#include
<boost/property_tree/ptree.hpp>
#include
<boost/property_tree/xml_parser.hpp>
#include
<boost/property_tree/json_parser.hpp>
#include
<logog/include/logog.hpp>
namespace
BaseLib
{
boost
::
property_tree
::
ptree
read_xml_config
(
boost
::
filesystem
::
path
const
&
path
)
{
boost
::
property_tree
::
ptree
ptree
;
...
...
@@ -28,4 +30,12 @@ boost::property_tree::ptree read_xml_config(boost::filesystem::path const& path)
return
ptree
;
}
std
::
string
propertyTreeToString
(
boost
::
property_tree
::
ptree
const
&
tree
)
{
std
::
ostringstream
ss
;
boost
::
property_tree
::
write_json
(
ss
,
tree
);
return
ss
.
str
();
}
}
This diff is collapsed.
Click to expand it.
BaseLib/ConfigTree.h
+
3
−
0
View file @
e9a218df
...
...
@@ -18,6 +18,9 @@ namespace BaseLib
boost
::
property_tree
::
ptree
read_xml_config
(
boost
::
filesystem
::
path
const
&
path
);
/// Returns the JSON-representation of the given boost::property_tree.
std
::
string
propertyTreeToString
(
boost
::
property_tree
::
ptree
const
&
tree
);
}
#endif // BASELIB_CONFIGTREE_H_
This diff is collapsed.
Click to expand it.
BaseLib/StringTools.cpp
+
0
−
8
View file @
e9a218df
...
...
@@ -20,7 +20,6 @@
#include
"logog/include/logog.hpp"
#include
<boost/property_tree/json_parser.hpp>
#include
<boost/algorithm/string/replace.hpp>
namespace
BaseLib
...
...
@@ -73,13 +72,6 @@ std::string padLeft(std::string const& str, int maxlen, char ch)
return
ss
.
str
();
}
std
::
string
propertyTreeToString
(
boost
::
property_tree
::
ptree
const
&
tree
)
{
std
::
ostringstream
ss
;
boost
::
property_tree
::
write_json
(
ss
,
tree
);
return
ss
.
str
();
}
}
// end namespace BaseLib
#ifdef MSVC
...
...
This diff is collapsed.
Click to expand it.
BaseLib/StringTools.h
+
0
−
6
View file @
e9a218df
...
...
@@ -15,7 +15,6 @@
#ifndef STRINGTOOLS_H
#define STRINGTOOLS_H
#include
<boost/property_tree/ptree.hpp>
#include
<string>
#include
<list>
...
...
@@ -71,11 +70,6 @@ void simplify(std::string &str);
*/
std
::
string
padLeft
(
std
::
string
const
&
str
,
int
maxlen
,
char
ch
=
' '
);
/**
* Returns the JSON-representation of the given boost::property_tree.
*/
std
::
string
propertyTreeToString
(
boost
::
property_tree
::
ptree
const
&
tree
);
}
// end namespace BaseLib
#ifdef MSVC
...
...
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