203 {
206 const std::locale loc {"C"};
207 while (std::getline(is, line))
208 {
211 const auto length = line.length();
212 if (length > 0)
213 {
214 const auto pos = std::find_if(line.begin(), line.end(), [this](CharT ch) { return format->is_assign(ch); });
215 const auto & front = line.front();
216 if (
format->is_comment(front))
217 {
218 }
219 else if (
format->is_section_start(front))
220 {
221 if (
format->is_section_end(line.back()))
222 section = line.substr(1, length - 2);
223 else
225 }
226 else if (pos != line.begin() && pos != line.end())
227 {
228 String variable(line.begin(), pos);
229 String value(pos + 1, line.end());
233 if (sec.find(variable) == sec.end())
234 sec.emplace(variable, value);
235 else
237 }
238 else
239 {
241 }
242 }
243 }
244 }
std::basic_string< CharT > String
Definition inipp.h:174
void rtrim(std::basic_string< CharT > &s, const std::locale &loc)
Definition inipp.h:56
void ltrim(std::basic_string< CharT > &s, const std::locale &loc)
Definition inipp.h:48