32std::map<std::string, std::string>
read_cfg(std::istream& is) {
33 std::map<std::string, std::string> kv;
43 if(s.empty() || s[0] ==
'#') {
47 s = clean_ws(s.substr(0, s.find(
'#')));
53 const auto eq = s.find(
'=');
55 if(eq == std::string::npos || eq == 0 || eq == s.size() - 1) {
56 throw Decoding_Error(
"Bad read_cfg input '" + s +
"' on line " + std::to_string(line));
59 const std::string key = clean_ws(s.substr(0, eq));
60 const std::string val = clean_ws(s.substr(eq + 1, std::string::npos));