1 #ifndef INICPP_PARSER_H 2 #define INICPP_PARSER_H 13 #include "exception.h" 15 #include "string_utils.h" 31 static size_t find_first_nonescaped(
const std::string &str,
char ch);
37 static size_t find_last_escaped(
const std::string &str,
char ch);
38 static std::string unescape(
const std::string &str);
39 static std::string delete_comment(
const std::string &str);
40 static std::vector<std::string> parse_option_list(
const std::string &str);
41 static void handle_links(
const config &cfg,
43 std::vector<std::string> &option_val_list,
45 static void validate_identifier(
const std::string &str,
size_t line_number);
47 static config internal_load(std::istream &str);
48 static void internal_save(
const config &cfg,
const schema &schm, std::ostream &str);
78 static config load(
const std::string &str);
89 static config load(
const std::string &str,
const schema &schm, schema_mode mode);
96 static config load(std::istream &str);
107 static config load(std::istream &str,
const schema &schm, schema_mode mode);
115 static config load_file(
const std::string &file);
126 static config load_file(
const std::string &file,
const schema &schm, schema_mode mode);
133 static void save(
const config &cfg,
const std::string &file);
139 static void save(
const config &cfg, std::ostream &str);
147 static void save(
const config &cfg,
const schema &schm,
const std::string &file);
155 static void save(
const config &cfg,
const schema &schm, std::ostream &str);
161 static void save(
const schema &schm,
const std::string &file);
167 static void save(
const schema &schm, std::ostream &str);