| 692 | } |
| 693 | |
| 694 | static bool WriteFile(u8string_view path) |
| 695 | { |
| 696 | try |
| 697 | { |
| 698 | auto directory = Path::GetDirectory(path); |
| 699 | Path::CreateDirectory(directory); |
| 700 | |
| 701 | auto fs = FileStream(path, FileMode::write); |
| 702 | auto writer = CreateIniWriter(&fs); |
| 703 | WriteGeneral(writer.get()); |
| 704 | WriteInterface(writer.get()); |
| 705 | WriteSound(writer.get()); |
| 706 | WriteNetwork(writer.get()); |
| 707 | WriteNotifications(writer.get()); |
| 708 | WriteFont(writer.get()); |
| 709 | WritePlugin(writer.get()); |
| 710 | return true; |
| 711 | } |
| 712 | catch (const std::exception& ex) |
| 713 | { |
| 714 | Console::WriteLine("Error saving to '%s'", u8string(path).c_str()); |
| 715 | Console::WriteLine(ex.what()); |
| 716 | return false; |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | /** |
| 721 | * Attempts to find the RCT1 installation directory. |
no test coverage detected