xoreos  0.0.5
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::TheWitcherSaveFile Class Reference

Class for reading and managing TheWitcherSave files. More...

#include <thewitchersavefile.h>

Inheritance diagram for Aurora::TheWitcherSaveFile:
Inheritance graph
[legend]
Collaboration diagram for Aurora::TheWitcherSaveFile:
Collaboration graph
[legend]

Classes

struct  IResource
 

Public Member Functions

 TheWitcherSaveFile (Common::SeekableReadStream *tws)
 
const Common::UStringgetAreaName () const
 Get the area name of this save file. More...
 
const ResourceListgetResources () const
 Return the list of resources. More...
 
uint32 getResourceSize (uint32 index) const
 Get the resource size. More...
 
Common::SeekableReadStreamgetResource (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< ResourceResourceList
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TheWitcherSaveFile()

Aurora::TheWitcherSaveFile::TheWitcherSaveFile ( Common::SeekableReadStream tws)

Definition at line 32 of file thewitchersavefile.cpp.

References load().

Here is the call graph for this function:

Member Function Documentation

◆ getAreaName()

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.

◆ getResource()

Common::SeekableReadStream * Aurora::TheWitcherSaveFile::getResource ( uint32  index,
bool  tryNoCopy = false 
) const
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().

Here is the call graph for this function:

◆ getResources()

const Archive::ResourceList & Aurora::TheWitcherSaveFile::getResources ( ) const
virtual

Return the list of resources.

Implements Aurora::Archive.

Definition at line 42 of file thewitchersavefile.cpp.

References _resourceList.

◆ getResourceSize()

uint32 Aurora::TheWitcherSaveFile::getResourceSize ( uint32  index) const
virtual

Get the resource size.

Reimplemented from Aurora::Archive.

Definition at line 125 of file thewitchersavefile.cpp.

References _resources.

◆ load()

void Aurora::TheWitcherSaveFile::load ( )
private

Member Data Documentation

◆ _areaName

Common::UString Aurora::TheWitcherSaveFile::_areaName
private

Definition at line 68 of file thewitchersavefile.h.

Referenced by getAreaName(), and load().

◆ _resourceList

ResourceList Aurora::TheWitcherSaveFile::_resourceList
private

Definition at line 70 of file thewitchersavefile.h.

Referenced by getResources(), and load().

◆ _resources

std::vector<IResource> Aurora::TheWitcherSaveFile::_resources
private

Definition at line 71 of file thewitchersavefile.h.

Referenced by getResource(), getResourceSize(), and load().

◆ _tws

Common::ScopedPtr<Common::SeekableReadStream> Aurora::TheWitcherSaveFile::_tws
private

Definition at line 66 of file thewitchersavefile.h.

Referenced by getResource(), and load().


The documentation for this class was generated from the following files: