37#include <unordered_map>
39#include "core_api.hpp"
43
44
45
47 ConfigManager() =
default;
50 ~ConfigManager() =
default;
52 static ConfigManager& get_instance();
55
56
57
58
59 bool load_config(
const std::filesystem::path& file_path);
62 [[nodiscard]] std::set<std::string> get_sections()
const;
65
66
67
68
69 [[nodiscard]] std::optional<std::string> get_value(
const std::string_view& key)
const;
72
73
74
75
76 [[nodiscard]] std::optional<int32_t> get_int_value(
const std::string_view& key)
const;
79
80
81
82
83 [[nodiscard]] std::optional<real_t> get_real_value(
const std::string_view& key)
const;
86
87
88
89
90 [[nodiscard]] std::optional<
bool> get_bool_value(
const std::string_view& key)
const;
94
95
96
97 virtual void parse_line(
const std::string_view& line);
99
100
101
102 virtual void parse_key_value(
const std::string_view& line);
104
105
106
107 virtual void parse_comment(
const std::string_view& line);
109
110
111
112 virtual void parse_section(
const std::string_view& line);
114
115
116
117 virtual void parse_blank(
const std::string_view& line);
119
120
121
124 std::unordered_map<std::string, std::string> _config;
126 std::string _current_section;
Definition config_manager.hpp:46