ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

default-saves.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #if !defined(BACKEND_SAVES_DEFAULT_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
00024 #define BACKEND_SAVES_DEFAULT_H
00025 
00026 #include "common/scummsys.h"
00027 #include "common/savefile.h"
00028 #include "common/str.h"
00029 #include "common/fs.h"
00030 #include "common/hash-str.h"
00031 #include <limits.h>
00032 
00036 class DefaultSaveFileManager : public Common::SaveFileManager {
00037 public:
00038     DefaultSaveFileManager();
00039     DefaultSaveFileManager(const Common::String &defaultSavepath);
00040 
00041     virtual void updateSavefilesList(Common::StringArray &lockedFiles);
00042     virtual Common::StringArray listSavefiles(const Common::String &pattern);
00043     virtual Common::InSaveFile *openRawFile(const Common::String &filename);
00044     virtual Common::InSaveFile *openForLoading(const Common::String &filename);
00045     virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
00046     virtual bool removeSavefile(const Common::String &filename);
00047 
00048 #ifdef USE_LIBCURL
00049 
00050     static const uint32 INVALID_TIMESTAMP = UINT_MAX;
00051     static const char *TIMESTAMPS_FILENAME;
00052 
00053     static Common::HashMap<Common::String, uint32> loadTimestamps();
00054     static void saveTimestamps(Common::HashMap<Common::String, uint32> &timestamps);
00055 #endif
00056 
00057     static Common::String concatWithSavesPath(Common::String name);
00058 
00059 protected:
00065     virtual Common::String getSavePath() const;
00066 
00071     virtual void checkPath(const Common::FSNode &dir);
00072 
00078     void assureCached(const Common::String &savePathName);
00079 
00080     typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SaveFileCache;
00081 
00089     SaveFileCache _saveFileCache;
00090 
00095     Common::StringArray _lockedFiles;
00096 
00097 private:
00101     Common::String _cachedDirectory;
00102 };
00103 
00104 #endif


Generated on Sat Nov 16 2019 05:00:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge