CRC Class Reference
Object representing an updateable CRC-32 checksum.
More...
#include <crc.h>
Public Member Functions |
| | CRC () |
| | Construct a new CRC object.
|
| void | UpdateData (const unsigned char *buf, unsigned bytes) |
| | Update CRC over the data in buf.
|
| void | UpdateData (const std::string &buf) |
| | Update CRC over the data in buf.
|
| bool | UpdateFile (const std::string &filename) |
| | Update CRC over the data in the specified file.
|
| void | ResetCRC () |
| | Resets CRC data to original state.
|
| unsigned int | GetCRC () const |
Static Private Member Functions |
| static void | GenerateCRCTable () |
| | Generate the lookup table used for CRC calculation.
|
Private Attributes |
| unsigned int | crc |
Static Private Attributes |
| static unsigned int | crcTable [256] |
Detailed Description
Object representing an updateable CRC-32 checksum.
Definition at line 7 of file crc.h.
Constructor & Destructor Documentation
Construct a new CRC object.
This generates the CRC table if it is the first CRC object being constructed.
Definition at line 33 of file crc.cpp.
Member Function Documentation
| void CRC::GenerateCRCTable |
( |
|
) |
[static, private] |
| unsigned int CRC::GetCRC |
( |
|
) |
const [inline] |
Definition at line 18 of file crc.h.
Resets CRC data to original state.
Definition at line 48 of file crc.cpp.
| void CRC::UpdateData |
( |
const std::string & |
buf |
) |
|
Update CRC over the data in buf.
Definition at line 55 of file crc.cpp.
| void CRC::UpdateData |
( |
const unsigned char * |
buf, |
|
|
unsigned |
bytes | |
|
) |
| | |
Update CRC over the data in buf.
Definition at line 41 of file crc.cpp.
| bool CRC::UpdateFile |
( |
const std::string & |
filename |
) |
|
Update CRC over the data in the specified file.
- Returns:
- true on success, false if file could not be opened.
Definition at line 63 of file crc.cpp.
Field Documentation
Definition at line 24 of file crc.h.
Definition at line 21 of file crc.h.
The documentation for this class was generated from the following files:
- /home/buildbot/slaves/docs/docs/build/src/crc.h
- /home/buildbot/slaves/docs/docs/build/src/crc.cpp