diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2011-02-09T12·41+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2011-02-09T12·41+0000 |
commit | d0eda1f3e9b2030e373038fd8997f033f2d7aedd (patch) | |
tree | 9db733f87fceaba36ddcba54b794b8be06c1d136 /src/libutil/hash.hh | |
parent | 3854fc9b42d16b810f62b64194b699033b03aaf1 (diff) | |
parent | 543988572e2abc85767da315b2acc1f971c5d07f (diff) |
* Merged the SQLite branch.
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r-- | src/libutil/hash.hh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 062d97254bfc..13740954d625 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -40,7 +40,6 @@ struct Hash /* For sorting. */ bool operator < (const Hash & h) const; - }; @@ -72,7 +71,8 @@ Hash hashFile(HashType ht, const Path & path); (essentially) hashString(ht, dumpPath(path)). */ struct PathFilter; extern PathFilter defaultPathFilter; -Hash hashPath(HashType ht, const Path & path, +typedef std::pair<Hash, unsigned long long> HashResult; +HashResult hashPath(HashType ht, const Path & path, PathFilter & filter = defaultPathFilter); /* Compress a hash to the specified number of bytes by cyclically @@ -93,16 +93,18 @@ class HashSink : public Sink private: HashType ht; Ctx * ctx; + unsigned long long bytes; public: HashSink(HashType ht); + HashSink(const HashSink & h); ~HashSink(); virtual void operator () (const unsigned char * data, unsigned int len); - Hash finish(); + HashResult finish(); }; } - + #endif /* !__HASH_H */ |