Loading...
Searching...
No Matches
configuration_tree.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24#ifndef __BITPIT_CONFIGURATION_TREE_HPP__
25#define __BITPIT_CONFIGURATION_TREE_HPP__
26
27#include "configuration_config.hpp"
28#include "configuration_common.hpp"
29
30#include "bitpit_common.hpp"
31
32#include <boost/property_tree/json_parser.hpp>
33#include <boost/property_tree/ptree.hpp>
34#include <boost/property_tree/xml_parser.hpp>
35
36namespace bitpit {
37
38namespace config {
39
40namespace tree {
41
42template<typename Source>
43void readConfiguration(Source &source, SourceFormat format, const std::string &rootName,
44 bool checkVersion, int version, Config *rootConfig);
45template<typename Destination>
46void writeConfiguration(Destination &destination, SourceFormat format, const std::string &rootName,
47 int version, const Config *rootConfig);
48
49void importTree(boost::property_tree::ptree const &root, Config *config);
50void exportTree(const Config &config, bool areArraysAllowed, boost::property_tree::ptree *root);
51
52template<typename Destination>
53void writeTree(Destination &destination, SourceFormat format, boost::property_tree::ptree &propertyTree);
54
55void writeTree(const std::string &filename, SourceFormat format, boost::property_tree::ptree &propertyTree);
56
57std::string readNodeValue(const boost::property_tree::ptree &node);
58
59}
60
61}
62
63}
64
65// Include template implementation
66#include "configuration_tree.tpp"
67
68#endif
GlobalConfigParser & root
--- layout: doxygen_footer ---