TCRC Class Reference

This class allow you compute CRC from specified resources. More...

#include <Crc.h>

Inheritance diagram for TCRC:

Inheritance graph
[legend]
Collaboration diagram for TCRC:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static DWORD ComputeCRC32 (const void *data, const DWORD &size)
 This method computes 32-bits CRC for specified data.
static DWORD UpdateCRC32 (DWORD startCRC, const void *data, const DWORD &size)
 This method actualize 32-bits CRC.
static BOOL ComputeVirtualFileCRC32 (TVirtualFile *file, DWORD &crc)
 Computes 32-bits of specified virtual file.
static BOOL ComputeFileCRC32 (const TString &filename, DWORD &crc)
 This method compute 32-bits of specified file from disk.

Detailed Description

This class allow you compute CRC from specified resources.

Definition at line 27 of file Crc.h.


Member Function Documentation

DWORD TCRC::ComputeCRC32 const void *  data,
const DWORD size
[static]
 

This method computes 32-bits CRC for specified data.

Parameters:
data [in] specified data
size [in] length of data in bytes

Definition at line 282 of file Crc.cpp.

BOOL TCRC::ComputeFileCRC32 const TString filename,
DWORD crc
[static]
 

This method compute 32-bits of specified file from disk.

Method returns TRUE if CRC was computed successfully.

Parameters:
filename [in] name of file to process
crc [out] computed CRC

Definition at line 382 of file Crc.cpp.

References DBGTEXTF, FALSE, TFile::Open(), and TRUE.

Here is the call graph for this function:

BOOL TCRC::ComputeVirtualFileCRC32 TVirtualFile file,
DWORD crc
[static]
 

Computes 32-bits of specified virtual file.

After return file position is undefined, you should set it.

Returns TRUE if CRC was computed successfully, FALSE otherwise.

Parameters:
file [in] valid pointer to virtual file
crc [out] computed CRC

Definition at line 332 of file Crc.cpp.

References NSFileSystem::TVirtualFile::Eof(), FALSE, NSFileSystem::TVirtualFile::Read(), NSFileSystem::TVirtualFile::SeekToStart(), and TRUE.

Here is the call graph for this function:

DWORD TCRC::UpdateCRC32 DWORD  crc,
const void *  data,
const DWORD size
[static]
 

This method actualize 32-bits CRC.

It may be used for computing CRC on large data buffer where buffer is separated into more small buffers

Initial CRC must be set to 0xFFFFFFFF. After computing all buffers you must invert final CRC such here: crc = crc ^ 0xFFFFFFFF

Parameters:
crc [in] initial crc
data [in] specified data
size [in] length of data in bytes

Definition at line 310 of file Crc.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 22:42:05 2007 for Joy4D by  doxygen 1.4.6-NO