//// Class Definition ////////////////////////////////////////////////////////
classhsRAMStream;
classplBSDiffBuffer;
classplDiffBuffer
{
protected:
hsBoolfWriting,f16BitMode;
UInt32fNewLength;
hsRAMStream*fStream;
// Support for BSDiff patch buffers (Patching only)
plBSDiffBuffer*fBSDiffBuffer;
hsBoolfIsBSDiff;
public:
plDiffBuffer(UInt32newLength,UInt32oldLength=0);// Constructor for writing new buffers. oldLength isn't required but helpful for optimizations
plDiffBuffer(void*buffer,UInt32length);// Constructor for applying a given diff set
// to an old buffer
virtual~plDiffBuffer();
/// Creation/write functions
// Add() appends an Add-New-Data operation to the diff buffer. The data supplied will be copied internally.
voidAdd(Int32length,void*newData);
// Copy() appends a Copy-Data-From-Old operation to the diff buffer
voidCopy(Int32length,UInt32oldOffset);
// GetBuffer() will copy the diff stream into a new buffer and return it. You are responsible for freeing the buffer.
voidGetBuffer(UInt32&length,void*&bufferPtr);
/// Apply functions
// Apply() will take this diff buffer and apply it to the given old buffer, allocating and producing a new buffer. You are responsible for freeing the new buffer.