ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge
Inheritance diagram for Grim::PatchedFile:
Collaboration diagram for Grim::PatchedFile:

List of all members.

Public Member Functions

 PatchedFile ()
virtual ~PatchedFile ()
bool load (Common::SeekableReadStream *file, const Common::String &patchName)
virtual bool eos () const override
 Returns true if a read failed because the stream end has been reached.
virtual uint32 read (void *dataPtr, uint32 dataSize) override
 Read data from the stream.
virtual int32 pos () const override
 Obtains the current value of the stream position indicator of the stream.
virtual int32 size () const override
 Obtains the total size of the stream, measured in bytes.
virtual bool seek (int32 offset, int whence=SEEK_SET) override
 Sets the stream position indicator for the stream.

Private Types

enum  Flags { FLAG_MIX_DIFF_EXTRA = 1 << 0, FLAG_COMPRESS_CTRL = 1 << 1 }

Private Member Functions

bool readNextInst ()

Private Attributes

Common::SeekableReadStream_file
Common::SeekableReadStream_ctrl
Common::SeekableReadStream_diff
Common::SeekableReadStream_extra
uint32 _diffCopy
uint32 _extraCopy
int32 _jump
int32 _instrLeft
int32 _pos
uint32 _flags
uint32 _newSize
uint8_diffBuffer
Common::String _patchName

Static Private Attributes

static const uint32 _kDiffBufferSize = 1024
static const uint32 _kHeaderSize = 48
static const uint32 _kMd5size = 5000
static const uint16 _kVersionMajor = 2
static const uint16 _kVersionMinor = 0

Detailed Description

Definition at line 34 of file patchr.cpp.


Member Enumeration Documentation

enum Grim::PatchedFile::Flags [private]
Enumerator:
FLAG_MIX_DIFF_EXTRA 
FLAG_COMPRESS_CTRL 

Definition at line 56 of file patchr.cpp.


Constructor & Destructor Documentation

Grim::PatchedFile::PatchedFile (  ) 

Definition at line 85 of file patchr.cpp.

Grim::PatchedFile::~PatchedFile (  )  [virtual]

Definition at line 92 of file patchr.cpp.


Member Function Documentation

bool Grim::PatchedFile::eos (  )  const [override, virtual]

Returns true if a read failed because the stream end has been reached.

This flag is cleared by clearErr(). For a SeekableReadStream, it is also cleared by a successful seek.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C feof(). In particular, in a stream with N bytes, reading exactly N bytes from the start should *not* set eos; only reading *beyond* the available data should set it.

Implements Common::ReadStream.

Definition at line 282 of file patchr.cpp.

bool Grim::PatchedFile::load ( Common::SeekableReadStream file,
const Common::String patchName 
)

Definition at line 103 of file patchr.cpp.

int32 Grim::PatchedFile::pos (  )  const [override, virtual]

Obtains the current value of the stream position indicator of the stream.

Returns:
the current position indicator, or -1 if an error occurred.

Implements Common::SeekableReadStream.

Definition at line 289 of file patchr.cpp.

uint32 Grim::PatchedFile::read ( void *  dataPtr,
uint32  dataSize 
) [override, virtual]

Read data from the stream.

Subclasses must implement this method; all other read methods are implemented using it.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fread(), in particular where it concerns setting error and end of file/stream flags.
Parameters:
dataPtr pointer to a buffer into which the data is read
dataSize number of bytes to be read
Returns:
the number of bytes which were actually read.

Implements Common::ReadStream.

Definition at line 194 of file patchr.cpp.

bool Grim::PatchedFile::readNextInst (  )  [private]

Definition at line 258 of file patchr.cpp.

bool Grim::PatchedFile::seek ( int32  offset,
int  whence = SEEK_SET 
) [override, virtual]

Sets the stream position indicator for the stream.

The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the seek() method clears the end-of-file indicator for the stream.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fseek().
Parameters:
offset the relative offset in bytes
whence the seek reference: SEEK_SET, SEEK_CUR, or SEEK_END
Returns:
true on success, false in case of a failure

Implements Common::SeekableReadStream.

Definition at line 297 of file patchr.cpp.

int32 Grim::PatchedFile::size (  )  const [override, virtual]

Obtains the total size of the stream, measured in bytes.

If this value is unknown or can not be computed, -1 is returned.

Returns:
the size of the stream, or -1 if an error occurred

Implements Common::SeekableReadStream.

Definition at line 293 of file patchr.cpp.


Member Data Documentation

Definition at line 63 of file patchr.cpp.

Definition at line 63 of file patchr.cpp.

Definition at line 74 of file patchr.cpp.

Definition at line 66 of file patchr.cpp.

Definition at line 63 of file patchr.cpp.

Definition at line 66 of file patchr.cpp.

Definition at line 62 of file patchr.cpp.

Definition at line 72 of file patchr.cpp.

Definition at line 68 of file patchr.cpp.

Definition at line 67 of file patchr.cpp.

const uint32 Grim::PatchedFile::_kDiffBufferSize = 1024 [static, private]

Definition at line 52 of file patchr.cpp.

const uint32 Grim::PatchedFile::_kHeaderSize = 48 [static, private]

Definition at line 52 of file patchr.cpp.

const uint32 Grim::PatchedFile::_kMd5size = 5000 [static, private]

Definition at line 52 of file patchr.cpp.

const uint16 Grim::PatchedFile::_kVersionMajor = 2 [static, private]

Definition at line 53 of file patchr.cpp.

const uint16 Grim::PatchedFile::_kVersionMinor = 0 [static, private]

Definition at line 53 of file patchr.cpp.

Definition at line 72 of file patchr.cpp.

Definition at line 76 of file patchr.cpp.

Definition at line 71 of file patchr.cpp.


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


Generated on Sat Jul 13 2019 05:04:13 for ResidualVM by doxygen 1.7.1
curved edge   curved edge