34 LocString description) : _stream(stream), _currentFileCount(0), _fileCount(fileCount) {
48 static const uint32 kLocStringTableOffset = 160;
58 std::time_t now = std::time(0);
59 std::tm *timepoint = std::localtime(&now);
#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.
A class holding an UTF-8 string.
uint32 getID() const
Return the string ID / StrRef.
uint32 getWrittenSize(bool withNullTerminate=false) const
Get the size, the string table will consume after being written.
static const uint32 kVersion10
uint32 _resourceTableOffset
virtual size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)=0
Sets the stream position indicator for the stream.
const char * c_str() const
Return the (utf8 encoded) string data.
ERFWriter(uint32 id, uint32 fileCount, Common::SeekableWriteStream &stream, Version version=kERFVersion10, LocString description=LocString())
Create an ERF writer by writing the header to the stream and reserve fileCount places in the key and ...
Writing BioWare's ERFs (encapsulated resource file).
The upper limit for numerical type IDs found in archives.
void writeUint16LE(uint16 value)
virtual size_t write(const void *dataPtr, size_t dataSize)=0
Write data into the stream.
uint32 getNumStrings() const
Get the number of strings.
Common::SeekableWriteStream & _stream
size_t size() const
Return the size of the string, in characters.
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 add(const Common::UString &resRef, FileType resType, Common::ReadStream &stream)
Add a new stream to this archive to be packed.
void writeUint32BE(uint32 value)
FORCEINLINE void writeZeros(size_t n)
Write n zeros to the stream.
uint32 _offsetToResourceData
void writeUint32LE(uint32 value)
void writeLocString(Common::WriteStream &stream, bool withNullTerminate=false) const
Write the LocString to a write stream.