1 #ifndef INICPP_SCHEMA_H 2 #define INICPP_SCHEMA_H 10 #include "option_schema.h" 11 #include "section_schema.h" 27 using sect_schema_vector = std::vector<std::shared_ptr<section_schema>>;
28 using sect_schema_map = std::map<std::string, std::shared_ptr<section_schema>>;
29 using sect_schema_map_pair = std::pair<std::string, std::shared_ptr<section_schema>>;
32 sect_schema_vector sections_;
34 sect_schema_map sections_map_;
79 void add_option(
const std::string §ion_name,
const option_schema &opt_schema);
88 template <
typename ArgType>
91 auto sect_it = sections_map_.find(section_name);
92 if (sect_it != sections_map_.end()) {
94 sect_it->second->add_option(opt_schema);
132 const section_schema &operator[](
const std::string §ion_name)
const;
138 bool contains(
const std::string §ion_name)
const;
146 void validate_config(
config &cfg, schema_mode mode)
const;
154 INICPP_API
friend std::ostream &operator<<(std::ostream &os,
const schema &schm);
157 INICPP_API std::ostream &operator<<(std::ostream &os,
const schema &schm);
void add_option(const std::string §ion_name, option_schema_params< ArgType > &arguments)