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

#include <thewitchersavewriter.h>

Collaboration diagram for Aurora::TheWitcherSaveWriter:
Collaboration graph
[legend]

Classes

struct  Resource
 

Public Member Functions

 TheWitcherSaveWriter (const Common::UString &areaName, Common::SeekableWriteStream &stream)
 Create a new TheWitcherSave writer. More...
 
void add (const Common::UString &resRef, const Aurora::FileType fileType, Common::ReadStream &stream)
 Add a file to this TheWitcherSave archive. More...
 
void finish ()
 Finish the stream and write the file table at the end of the stream, and set the finished flag to prevent further adds. More...
 

Private Attributes

Common::SeekableWriteStream_stream
 
bool _finished
 
std::vector< Resource_resources
 

Detailed Description

Definition at line 34 of file thewitchersavewriter.h.

Constructor & Destructor Documentation

◆ TheWitcherSaveWriter()

Aurora::TheWitcherSaveWriter::TheWitcherSaveWriter ( const Common::UString areaName,
Common::SeekableWriteStream stream 
)

Create a new TheWitcherSave writer.

Parameters
areaNameSet the area name which should be written into the header.
streamThe stream to write the file to.

Definition at line 34 of file thewitchersavewriter.cpp.

References Common::kEncodingUTF16LE, Aurora::kRGMHID, Common::writeStringFixed(), Common::WriteStream::writeUint32BE(), Common::WriteStream::writeUint32LE(), Common::WriteStream::writeUint64LE(), and Common::WriteStream::writeZeros().

Here is the call graph for this function:

Member Function Documentation

◆ add()

void Aurora::TheWitcherSaveWriter::add ( const Common::UString resRef,
const Aurora::FileType  fileType,
Common::ReadStream stream 
)

Add a file to this TheWitcherSave archive.

Parameters
resRefThe filename of the stream to write
fileTypeThe file type of the resource to add
streamThe stream of the

Definition at line 65 of file thewitchersavewriter.cpp.

References _finished, _resources, _stream, Aurora::TheWitcherSaveWriter::Resource::name, Aurora::TheWitcherSaveWriter::Resource::offset, Common::SeekableWriteStream::pos(), Aurora::TheWitcherSaveWriter::Resource::size, TypeMan, and Common::WriteStream::writeStream().

Here is the call graph for this function:

◆ finish()

void Aurora::TheWitcherSaveWriter::finish ( )

Finish the stream and write the file table at the end of the stream, and set the finished flag to prevent further adds.

Definition at line 77 of file thewitchersavewriter.cpp.

References _finished, _resources, _stream, Common::kEncodingASCII, Aurora::TheWitcherSaveWriter::Resource::name, Aurora::TheWitcherSaveWriter::Resource::offset, Common::SeekableWriteStream::pos(), Aurora::TheWitcherSaveWriter::Resource::size, Common::UString::size(), Common::writeString(), and Common::WriteStream::writeUint32LE().

Here is the call graph for this function:

Member Data Documentation

◆ _finished

bool Aurora::TheWitcherSaveWriter::_finished
private

Definition at line 66 of file thewitchersavewriter.h.

Referenced by add(), and finish().

◆ _resources

std::vector<Resource> Aurora::TheWitcherSaveWriter::_resources
private

Definition at line 67 of file thewitchersavewriter.h.

Referenced by add(), and finish().

◆ _stream

Common::SeekableWriteStream& Aurora::TheWitcherSaveWriter::_stream
private

Definition at line 64 of file thewitchersavewriter.h.

Referenced by add(), and finish().


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