mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-02 23:49:40 +00:00
WINTERMUTE: Use const Common::String& for the file-accessors.
This commit is contained in:
parent
b94c379263
commit
b1e4f58fed
@ -53,7 +53,7 @@ CBDiskFile::~CBDiskFile() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBDiskFile::Open(Common::String Filename) {
|
||||
HRESULT CBDiskFile::Open(const Common::String &Filename) {
|
||||
Close();
|
||||
|
||||
char FullPath[MAX_PATH];
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN);
|
||||
virtual HRESULT Read(void *Buffer, uint32 Size);
|
||||
virtual HRESULT Close();
|
||||
virtual HRESULT Open(Common::String Filename);
|
||||
virtual HRESULT Open(const Common::String &Filename);
|
||||
private:
|
||||
void CorrectSlashes(char *fileName);
|
||||
Common::SeekableReadStream *_file;
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN) = 0;
|
||||
virtual HRESULT Read(void *Buffer, uint32 Size) = 0;
|
||||
virtual HRESULT Close() = 0;
|
||||
virtual HRESULT Open(Common::String Filename) = 0;
|
||||
virtual HRESULT Open(const Common::String &Filename) = 0;
|
||||
virtual bool IsEOF();
|
||||
CBFile(CBGame *inGame);
|
||||
virtual ~CBFile();
|
||||
|
@ -785,10 +785,10 @@ HRESULT CBFileManager::CloseFile(CBFile *File) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBFile *CBFileManager::OpenFileRaw(const char *Filename) {
|
||||
CBFile *CBFileManager::OpenFileRaw(const Common::String &Filename) {
|
||||
RestoreCurrentDir();
|
||||
|
||||
if (scumm_strnicmp(Filename, "savegame:", 9) == 0) {
|
||||
if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) == 0) {
|
||||
CBSaveThumbFile *SaveThumbFile = new CBSaveThumbFile(Game);
|
||||
if (SUCCEEDED(SaveThumbFile->Open(Filename))) return SaveThumbFile;
|
||||
else {
|
||||
@ -809,7 +809,7 @@ CBFile *CBFileManager::OpenFileRaw(const char *Filename) {
|
||||
if (SUCCEEDED(ResFile->Open(Filename))) return ResFile;
|
||||
|
||||
delete ResFile;
|
||||
warning("BFileManager::OpenFileRaw - Failed to open %s", Filename);
|
||||
warning("BFileManager::OpenFileRaw - Failed to open %s", Filename.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "coll_templ.h"
|
||||
#include "BFileEntry.h"
|
||||
#include "common/archive.h"
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Common {
|
||||
class File;
|
||||
@ -49,7 +50,7 @@ public:
|
||||
HRESULT RestoreCurrentDir();
|
||||
char *_basePath;
|
||||
bool GetFullPath(const char *Filename, char *Fullname);
|
||||
CBFile *OpenFileRaw(const char *Filename);
|
||||
CBFile *OpenFileRaw(const Common::String &filename);
|
||||
HRESULT CloseFile(CBFile *File);
|
||||
CBFile *OpenFile(const char *Filename, bool AbsPathWarning = true);
|
||||
CBFileEntry *GetPackageEntry(const char *Filename);
|
||||
|
@ -54,7 +54,7 @@ CBPkgFile::~CBPkgFile() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBPkgFile::Open(Common::String Filename) {
|
||||
HRESULT CBPkgFile::Open(const Common::String &Filename) {
|
||||
Close();
|
||||
|
||||
char fileName[MAX_PATH];
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN);
|
||||
virtual HRESULT Read(void *Buffer, uint32 Size);
|
||||
virtual HRESULT Close();
|
||||
virtual HRESULT Open(Common::String Filename);
|
||||
virtual HRESULT Open(const Common::String &Filename);
|
||||
private:
|
||||
bool _inflateInit;
|
||||
HRESULT SeekToPos(uint32 NewPos);
|
||||
|
@ -45,7 +45,7 @@ CBResourceFile::~CBResourceFile() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBResourceFile::Open(Common::String Filename) {
|
||||
HRESULT CBResourceFile::Open(const Common::String &Filename) {
|
||||
Close();
|
||||
|
||||
if (CBResources::GetFile(Filename.c_str(), _data, _size)) {
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN);
|
||||
virtual HRESULT Read(void *Buffer, uint32 Size);
|
||||
virtual HRESULT Close();
|
||||
virtual HRESULT Open(Common::String Filename);
|
||||
virtual HRESULT Open(const Common::String &Filename);
|
||||
private:
|
||||
byte *_data;
|
||||
};
|
||||
|
@ -51,7 +51,7 @@ CBSaveThumbFile::~CBSaveThumbFile() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBSaveThumbFile::Open(Common::String Filename) {
|
||||
HRESULT CBSaveThumbFile::Open(const Common::String &Filename) {
|
||||
Close();
|
||||
|
||||
if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) != 0) return E_FAIL;
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN);
|
||||
virtual HRESULT Read(void *Buffer, uint32 Size);
|
||||
virtual HRESULT Close();
|
||||
virtual HRESULT Open(Common::String Filename);
|
||||
virtual HRESULT Open(const Common::String &Filename);
|
||||
private:
|
||||
byte *_data;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user