| 103 | } |
| 104 | |
| 105 | std::string common_preset::to_ini() const { |
| 106 | std::ostringstream ss; |
| 107 | |
| 108 | ss << "[" << name << "]\n"; |
| 109 | for (const auto & [opt, value] : options) { |
| 110 | auto espaced_value = value; |
| 111 | string_replace_all(espaced_value, "\n", "\\\n"); |
| 112 | ss << rm_leading_dashes(opt.args.back()) << " = "; |
| 113 | ss << espaced_value << "\n"; |
| 114 | } |
| 115 | ss << "\n"; |
| 116 | |
| 117 | return ss.str(); |
| 118 | } |
| 119 | |
| 120 | void common_preset::set_option(const common_preset_context & ctx, const std::string & env, const std::string & value) { |
| 121 | // try if option exists, update it |
no test coverage detected