xoreos
0.0.5
|
Class for reading and managing TheWitcherSave files. More...
#include <thewitchersavefile.h>
Classes | |
struct | IResource |
Public Member Functions | |
TheWitcherSaveFile (Common::SeekableReadStream *tws) | |
const Common::UString & | getAreaName () const |
Get the area name of this save file. More... | |
const ResourceList & | getResources () const |
Return the list of resources. More... | |
uint32 | getResourceSize (uint32 index) const |
Get the resource size. More... | |
Common::SeekableReadStream * | getResource (uint32 index, bool tryNoCopy=false) const |
Return a stream of the resource's contents. More... | |
Public Member Functions inherited from Aurora::Archive | |
Archive () | |
virtual | ~Archive () |
virtual Common::HashAlgo | getNameHashAlgo () const |
Return with which algorithm the name is hashed. More... | |
uint32 | findResource (uint64 hash) const |
Return the index of the resource matching the hash, or 0xFFFFFFFF if not found. More... | |
uint32 | findResource (const Common::UString &name, FileType type) const |
Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found. More... | |
Private Member Functions | |
void | load () |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _tws |
Common::UString | _areaName |
ResourceList | _resourceList |
std::vector< IResource > | _resources |
Additional Inherited Members | |
Public Types inherited from Aurora::Archive | |
typedef std::list< Resource > | ResourceList |
Class for reading and managing TheWitcherSave files.
A TheWitcherSave file is basically an archive containing savegame files, for example a tga image for the save game browser, or a player.utc containing Geralt's stats.
This implementation is based on https://github.com/boazy/TWEditorEnhanced
Definition at line 42 of file thewitchersavefile.h.
Aurora::TheWitcherSaveFile::TheWitcherSaveFile | ( | Common::SeekableReadStream * | tws | ) |
Definition at line 32 of file thewitchersavefile.cpp.
References load().
const Common::UString & Aurora::TheWitcherSaveFile::getAreaName | ( | ) | const |
Get the area name of this save file.
Definition at line 38 of file thewitchersavefile.cpp.
References _areaName.
|
virtual |
Return a stream of the resource's contents.
Implements Aurora::Archive.
Definition at line 46 of file thewitchersavefile.cpp.
References _resources, _tws, Common::ScopedPtrBase< T, Deallocator >::get(), Aurora::TheWitcherSaveFile::IResource::length, Aurora::TheWitcherSaveFile::IResource::offset, and Common::readStream().
|
virtual |
Return the list of resources.
Implements Aurora::Archive.
Definition at line 42 of file thewitchersavefile.cpp.
References _resourceList.
Get the resource size.
Reimplemented from Aurora::Archive.
Definition at line 125 of file thewitchersavefile.cpp.
References _resources.
|
private |
Definition at line 58 of file thewitchersavefile.cpp.
References _areaName, _resourceList, _resources, _tws, Aurora::Archive::Resource::index, Common::kEncodingUTF16LE, Common::kEncodingUTF8, Aurora::kFileTypeNone, Common::SeekableReadStream::kOriginEnd, Aurora::kRGMHID, Aurora::TheWitcherSaveFile::IResource::length, Aurora::Archive::Resource::name, Aurora::TheWitcherSaveFile::IResource::offset, Common::readStringFixed(), Common::UString::replaceAll(), Aurora::Archive::Resource::type, and TypeMan.
Referenced by TheWitcherSaveFile().
|
private |
Definition at line 68 of file thewitchersavefile.h.
Referenced by getAreaName(), and load().
|
private |
Definition at line 70 of file thewitchersavefile.h.
Referenced by getResources(), and load().
|
private |
Definition at line 71 of file thewitchersavefile.h.
Referenced by getResource(), getResourceSize(), and load().
|
private |
Definition at line 66 of file thewitchersavefile.h.
Referenced by getResource(), and load().