diff options
author | Max Horn | 2006-04-14 01:48:51 +0000 |
---|---|---|
committer | Max Horn | 2006-04-14 01:48:51 +0000 |
commit | 1470dadb1de3250dfceeaa246604ca0f26889bbf (patch) | |
tree | 3bd75cabff52222dba1fc1f408e4f21917749aed /common/file.cpp | |
parent | 507281610935fb2adcbae0c5f0d6239defdd8ffa (diff) | |
download | scummvm-rg350-1470dadb1de3250dfceeaa246604ca0f26889bbf.tar.gz scummvm-rg350-1470dadb1de3250dfceeaa246604ca0f26889bbf.tar.bz2 scummvm-rg350-1470dadb1de3250dfceeaa246604ca0f26889bbf.zip |
Changed File::open to take a Common::String as file name parameter
svn-id: r21867
Diffstat (limited to 'common/file.cpp')
-rw-r--r-- | common/file.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/common/file.cpp b/common/file.cpp index 038e7e3fd2..00707c4f7e 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -67,7 +67,6 @@ static FILE *fopenNoCase(const String &filename, const String &directory, const // Try again, with file name converted to upper case // if (!file) { - for (i = offsetToFileName; i < buf.size(); ++i) { buf[i] = toupper(buf[i]); } @@ -185,20 +184,19 @@ void File::decRef() { } -bool File::open(const char *f, AccessMode mode, const char *directory) { +bool File::open(const String &filename, AccessMode mode, const char *directory) { assert(mode == kFileReadMode || mode == kFileWriteMode); - if (f == NULL || *f == 0) { + if (filename.empty()) { error("File::open: No filename was specified!"); } if (_handle) { - error("File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), f); + error("File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), filename.c_str()); } clearIOFailed(); - String filename(f); String fname(filename); fname.toLowercase(); @@ -265,7 +263,7 @@ bool File::open(const char *f, AccessMode mode, const char *directory) { return true; } -bool File::exists(const char *filename, const char *directory) { +bool File::exists(const String &filename, const char *directory) { // FIXME: Ugly ugly hack! File tmp; return tmp.open(filename, kFileReadMode, directory); |