35 _stream(stream), _finished(false) {
70 resource.
name =
TypeMan.setFileType(resRef, fileType);
81 const size_t resourceTableOffset =
_stream.
pos();
83 for (
size_t i = 0; i <
_resources.size(); ++i) {
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
Generic interface for a readable data stream.
#define TypeMan
Shortcut for accessing the file type manager.
A class holding an UTF-8 string.
Writer for writing TheWitcherSave files.
size_t writeString(WriteStream &stream, const Common::UString &str, Encoding encoding, bool terminate)
Write a string into a stream with a given encoding.
Utility functions to handle files used in BioWare's Aurora engine.
UTF-16 LE (little endian).
void writeUint64LE(uint64 value)
virtual size_t pos() const =0
Obtains the current value of the stream position indicator of the stream.
std::vector< Resource > _resources
Utility functions for working with differing string encodings.
Plain, unextended ASCII (7bit clean).
void add(const Common::UString &resRef, const Aurora::FileType fileType, Common::ReadStream &stream)
Add a file to this TheWitcherSave archive.
size_t size() const
Return the size of the string, in characters.
static const uint32 kRGMHID
size_t writeStream(ReadStream &stream, size_t n)
Copy n bytes of the given stream into the stream.
FileType
Various file types used by the Aurora engine and found in archives.
void writeUint32BE(uint32 value)
FORCEINLINE void writeZeros(size_t n)
Write n zeros to the stream.
TheWitcherSaveWriter(const Common::UString &areaName, Common::SeekableWriteStream &stream)
Create a new TheWitcherSave writer.
void finish()
Finish the stream and write the file table at the end of the stream, and set the finished flag to pre...
Common::SeekableWriteStream & _stream
void writeUint32LE(uint32 value)
void writeStringFixed(WriteStream &stream, const Common::UString &str, Encoding encoding, size_t length)
Write a string into a stream with a given encoding and fixed length in bytes.