blob: 7ab7543419b330f955bc22ca801394f096d925c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef CORE_CONFIG_MAP_HH
#define CORE_CONFIG_MAP_HH 1
#pragma once
namespace config
{
class IValue;
} // namespace config
namespace io
{
class ConfigMap final {
public:
ConfigMap(void) = default;
virtual ~ConfigMap(void) = default;
void load_cmdline(void);
bool load_file(std::string_view path);
bool save_file(std::string_view path) const;
bool set_value(std::string_view name, std::string_view value);
std::string_view get_value(std::string_view name) const;
void add_value(std::string_view name, config::IValue& vref);
const config::IValue* find(std::string_view name) const;
private:
std::unordered_map<std::string, config::IValue*> m_values;
};
} // namespace io
#endif // CORE_CONFIG_MAP_HH
|