| 452 | } |
| 453 | |
| 454 | void Config::applyOptionsFile(const std::string& data) |
| 455 | { |
| 456 | if (!data.empty()) |
| 457 | { |
| 458 | for (auto setting : split(data, '\n')) |
| 459 | { |
| 460 | setting = trimWhitespace(setting); |
| 461 | if (setting.size() == 0) |
| 462 | continue; |
| 463 | if (setting[0] == '#') |
| 464 | continue; |
| 465 | |
| 466 | auto equals = setting.find('='); |
| 467 | if (equals == std::string::npos) |
| 468 | error("Malformed setting line '{}'", setting); |
| 469 | |
| 470 | auto key = setting.substr(0, equals); |
| 471 | auto value = setting.substr(equals + 1); |
| 472 | globalConfig().set(key, value); |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | void Config::applyDefaultOptions() |
| 478 | { |
no test coverage detected