Made sure that when properties are saved in Console::saveProperties,

all spaces are removed from the filename.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@124 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2002-11-10 19:05:57 +00:00
parent 3dbc0b7193
commit a12078de97
2 changed files with 10 additions and 7 deletions

View File

@ -13,13 +13,14 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.cxx,v 1.5 2002-11-09 23:29:51 stephena Exp $
// $Id: Console.cxx,v 1.6 2002-11-10 19:05:57 stephena Exp $
//============================================================================
#include <assert.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <algorithm>
#include "Booster.hxx"
#include "Cart.hxx"
@ -398,9 +399,12 @@ void Console::changeHeight(const uInt32 direction)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::saveProperties(const string& filename)
void Console::saveProperties(string& filename)
{
string message;
// Replace all spaces in filename with underscores
replace(filename.begin(), filename.end(), ' ', '_');
ofstream out(filename.c_str(), ios::out);
if(out && out.is_open())

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.hxx,v 1.4 2002-11-09 23:29:51 stephena Exp $
// $Id: Console.hxx,v 1.5 2002-11-10 19:05:57 stephena Exp $
//============================================================================
#ifndef CONSOLE_HXX
@ -36,7 +36,7 @@ class System;
This class represents the entire game console.
@author Bradford W. Mott
@version $Id: Console.hxx,v 1.4 2002-11-09 23:29:51 stephena Exp $
@version $Id: Console.hxx,v 1.5 2002-11-10 19:05:57 stephena Exp $
*/
class Console
{
@ -174,12 +174,11 @@ class Console
void changeHeight(const uInt32 direction);
/**
Save a copy of the current properties.
after the change.
Save a copy of the current properties after any changes.
@param filename Filename to save the properties into.
*/
void saveProperties(const string& filename);
void saveProperties(string& filename);
#endif
private: