24#ifndef __BITPIT_CONFIGURATION_CONFIG_HPP__
25#define __BITPIT_CONFIGURATION_CONFIG_HPP__
40 typedef std::vector<Section *> MultiSection;
41 typedef std::vector<const Section *> ConstMultiSection;
42 typedef std::map<std::string, std::string> Options;
43 typedef std::multimap<std::string, std::unique_ptr<Config>> Sections;
45 Config(
bool multiSections =
false);
61 bool hasOption(
const std::string &key)
const;
62 const std::string &
get(
const std::string &key)
const;
63 std::string
get(
const std::string &key,
const std::string &fallback)
const;
64 void set(
const std::string &key,
const std::string &value);
72 ConstMultiSection
getSections(
const std::string &key)
const;
81 void dump(std::ostream &out,
int indentLevel = 0)
const;
87 T
get(
const std::string &key)
const;
90 T
get(
const std::string &key,
const T &fallback)
const;
93 void set(
const std::string &key,
const T &value);
99 std::unique_ptr<Options> m_options;
100 std::unique_ptr<Sections> m_sections;
106#include "configuration_config.tpp"
void dump(std::ostream &out, int indentLevel=0) const
const std::string & get(const std::string &key) const
Section & addSection(const std::string &key)
Config & operator=(Config other)
Section & operator[](const std::string &key)
Section & getSection(const std::string &key)
bool hasOption(const std::string &key) const
bool isMultiSectionsEnabled() const
int getOptionCount() const
int getSectionCount() const
bool hasSection(const std::string &key) const
void set(const std::string &key, const std::string &value)
bool removeSection(const std::string &key)
bool removeOption(const std::string &key)
Config(bool multiSections=false)