Exemple #1
0
void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED(event))
{
    SaveGameConfig();
    // Create blank file to prevent editor from prompting to create it.
    if (!File::Exists(GameIniFileLocal))
    {
        std::fstream blankFile(GameIniFileLocal, std::ios::out);
        blankFile.close();
    }
    LaunchExternalEditor(GameIniFileLocal, true);
    GenerateLocalIniModified();
}
Exemple #2
0
//Creates blank file with empty default constructor,if the file doesn't exist
void LastTenGames::createBlankFile()
{
	if (!fileExist("previousGames.txt"))
	{
		PreviousGame blankGame;

		std::ofstream blankFile("previousGames.txt", std::ios::out);
		if (!blankFile)
		{
			std::cerr << "File could not be opened." << std::endl;
			exit(1);
		}
		for (int i = 0; i < 10; i++)
		{
			blankFile.write(reinterpret_cast<const char*>(&blankGame), sizeof(PreviousGame));
		}
		blankFile.close();
	}
}