2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-06-24 10:08:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-03-16 23:07:08 +00:00
|
|
|
#if !defined(BACKEND_SAVES_DEFAULT_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
|
2006-06-24 10:08:43 +00:00
|
|
|
#define BACKEND_SAVES_DEFAULT_H
|
|
|
|
|
|
|
|
#include "common/savefile.h"
|
2007-07-12 17:58:15 +00:00
|
|
|
#include "common/str.h"
|
2008-09-02 13:05:43 +00:00
|
|
|
#include "common/fs.h"
|
2006-06-24 10:08:43 +00:00
|
|
|
|
2007-12-28 07:37:04 +00:00
|
|
|
/**
|
|
|
|
* Provides a default savefile manager implementation for common platforms.
|
|
|
|
*/
|
2006-06-24 10:08:43 +00:00
|
|
|
class DefaultSaveFileManager : public Common::SaveFileManager {
|
|
|
|
public:
|
2008-08-04 17:17:37 +00:00
|
|
|
DefaultSaveFileManager();
|
2008-08-04 19:38:28 +00:00
|
|
|
DefaultSaveFileManager(const Common::String &defaultSavepath);
|
2008-08-04 17:17:37 +00:00
|
|
|
|
2007-12-30 13:05:38 +00:00
|
|
|
virtual Common::StringList listSavefiles(const char *pattern);
|
2006-06-24 10:08:43 +00:00
|
|
|
virtual Common::InSaveFile *openForLoading(const char *filename);
|
2007-09-18 20:02:04 +00:00
|
|
|
virtual Common::OutSaveFile *openForSaving(const char *filename);
|
2007-07-29 01:36:59 +00:00
|
|
|
virtual bool removeSavefile(const char *filename);
|
2007-12-28 07:37:04 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* Get the path to the savegame directory.
|
|
|
|
* Should only be used internally since some platforms
|
|
|
|
* might implement savefiles in a completely different way.
|
|
|
|
*/
|
2007-12-28 21:12:30 +00:00
|
|
|
virtual Common::String getSavePath() const;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-12-28 07:37:04 +00:00
|
|
|
/**
|
|
|
|
* Checks the given path for read access, existence, etc.
|
|
|
|
* Sets the internal error and error message accordingly.
|
|
|
|
*/
|
2008-10-02 16:58:59 +00:00
|
|
|
void checkPath(const Common::FSNode &dir);
|
2006-06-24 10:08:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|