Changeset View
Changeset View
Standalone View
Standalone View
src/hash.h
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Reads data from an underlying stream, while hashing the read data. | * Reads data from an underlying stream, while hashing the read data. | ||||
*/ | */ | ||||
template <typename Source> class CHashVerifier : public CHashWriter { | template <typename Source> class CHashVerifier : public CHashWriter { | ||||
private: | private: | ||||
Source *source; | Source *source; | ||||
public: | public: | ||||
CHashVerifier(Source *source_) | explicit CHashVerifier(Source *source_) | ||||
: CHashWriter(source_->GetType(), source_->GetVersion()), | : CHashWriter(source_->GetType(), source_->GetVersion()), | ||||
source(source_) {} | source(source_) {} | ||||
void read(char *pch, size_t nSize) { | void read(char *pch, size_t nSize) { | ||||
source->read(pch, nSize); | source->read(pch, nSize); | ||||
this->write(pch, nSize); | this->write(pch, nSize); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |