| 247 | } |
| 248 | |
| 249 | void Settings::readFile() |
| 250 | { |
| 251 | ifstream file; |
| 252 | string line; |
| 253 | |
| 254 | log.push_back(strpr("Settings file name: %s\n", fileName.c_str())); |
| 255 | file.open(fileName.c_str()); |
| 256 | if (!file.is_open()) |
| 257 | { |
| 258 | throw runtime_error("ERROR: Could not open file: \"" + fileName |
| 259 | + "\".\n"); |
| 260 | } |
| 261 | |
| 262 | while (getline(file, line)) |
| 263 | { |
| 264 | lines.push_back(line); |
| 265 | } |
| 266 | |
| 267 | file.close(); |
| 268 | |
| 269 | log.push_back(strpr("Read %zu lines.\n", lines.size())); |
| 270 | |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | void Settings::writeSettingsFile(ofstream* const& file, |
| 275 | map<size_t, string> const& replacements) const |