forked from mirror/OpenTTD
(svn r22168) -Codechange: Move ini file IO and file error reporting to virtual functions.
This commit is contained in:
12
src/ini.cpp
12
src/ini.cpp
@@ -105,3 +105,15 @@ bool IniFile::SaveToDisk(const char *filename)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* virtual */ FILE *IniFile::OpenFile(const char *filename, size_t *size)
|
||||
{
|
||||
/* Open the text file in binary mode to prevent end-of-line translations
|
||||
* done by ftell() and friends, as defined by K&R. */
|
||||
return FioFOpenFile(filename, "rb", DATA_DIR, size);
|
||||
}
|
||||
|
||||
/* virtual */ void IniFile::ReportFileError(const char * const pre, const char * const buffer, const char * const post)
|
||||
{
|
||||
ShowInfoF("%s%s%s", pre, buffer, post);
|
||||
}
|
||||
|
Reference in New Issue
Block a user