24#ifndef __BITPIT_CONFIGURATION_HPP__
25#define __BITPIT_CONFIGURATION_HPP__
30#include "bitpit_common.hpp"
32#include "configuration_common.hpp"
33#include "configuration_config.hpp"
43 ConfigParser(
const std::string &rootName,
bool multiSections);
45 ConfigParser(
const std::string &rootName,
int version,
bool multiSections);
47 void reset(
const std::string &rootName);
48 void reset(
const std::string &rootName,
int version);
49 void reset(
const std::string &rootName,
int version,
bool multiSections);
51 void read(
const std::string &filename,
bool append =
true);
52 void read(config::SourceFormat format,
const std::string &content,
bool append =
true);
53 void write(
const std::string &filename)
const;
54 void write(config::SourceFormat format, std::string *content)
const;
57 BITPIT_PUBLIC_API
static const int VERSION_UNDEFINED;
59 std::string m_rootName;
71 static GlobalConfigParser &
parser();
74 static const std::string DEFAULT_ROOT_NAME;
75 static const int DEFAULT_VERSION;
77 static std::unique_ptr<GlobalConfigParser> m_parser;
80 GlobalConfigParser(
const std::string &rootName,
int version);
81 GlobalConfigParser(
const std::string &rootName,
bool multiSections);
82 GlobalConfigParser(
const std::string &rootName,
int version,
bool multiSections);
84 GlobalConfigParser(GlobalConfigParser
const&) =
delete;
85 GlobalConfigParser& operator=(GlobalConfigParser
const&) =
delete;
100 void reset(
const std::string &rootName);
101 void reset(
const std::string &rootName,
int version);
102 void reset(
const std::string &rootName,
int version,
bool multiSections);
104 void read(
const std::string &filename,
bool append =
true);
105 void read(config::SourceFormat format,
const std::string &content,
bool append =
true);
106 void write(
const std::string &filename);
107 void write(config::SourceFormat format, std::string *content);
void write(const std::string &filename) const
ConfigParser(const std::string &rootName)
void read(const std::string &filename, bool append=true)
void reset(const std::string &rootName)
Config(bool multiSections=false)
Global configuration file parser.
static GlobalConfigParser & parser()
The namespace 'config' contains routines for interacting with the global configuration file parser.
void write(const std::string &filename)
GlobalConfigParser & root
void read(const std::string &filename, bool append)