| 222 | } |
| 223 | |
| 224 | int Confparse::SaveDefault(const filesystem::path &filepath) { |
| 225 | ofstream file; |
| 226 | file.open(filepath, std::ios::out | std::ios::binary | std::ios::ate); |
| 227 | |
| 228 | nested = true; |
| 229 | if (file.is_open()) { |
| 230 | file.write(default_conf, sizeof(default_conf) - 1); |
| 231 | file.close(); |
| 232 | Load(filepath); |
| 233 | |
| 234 | return 0; |
| 235 | } else { |
| 236 | return 1; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | int Confparse::Load(const filesystem::path &filepath, bool save_default) { |
| 241 | ifstream file; |