MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / WriteFile

Function WriteFile

src/openrct2/config/Config.cpp:694–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers 1

SaveToPathFunction · 0.85

Calls 14

GetDirectoryFunction · 0.85
CreateDirectoryFunction · 0.85
FileStreamClass · 0.85
CreateIniWriterFunction · 0.85
WriteGeneralFunction · 0.85
WriteInterfaceFunction · 0.85
WriteSoundFunction · 0.85
WriteNetworkFunction · 0.85
WriteNotificationsFunction · 0.85
WriteFontFunction · 0.85
WritePluginFunction · 0.85
WriteLineFunction · 0.85

Tested by

no test coverage detected