diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-10-21 18:48:21 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-10-21 18:48:21 +0200 |
commit | 9a18f544ac09c3a40e9a87c166edd878a1368c6f (patch) | |
tree | 9a2dcd0d4545f46c2c3e3930239f9a503903db19 /src/libutil/hash.hh | |
parent | b82f75464d1e5ae9a00d8004e5dd7b1ca05059e4 (diff) | |
parent | 629b9b0049363e091b76b7f60a8357d9f94733cc (diff) |
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r-- | src/libutil/hash.hh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index edede8ace..ea9fca3e7 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -123,7 +123,12 @@ string printHashType(HashType ht); union Ctx; -class HashSink : public BufferedSink +struct AbstractHashSink : virtual Sink +{ + virtual HashResult finish() = 0; +}; + +class HashSink : public BufferedSink, public AbstractHashSink { private: HashType ht; @@ -134,8 +139,8 @@ public: HashSink(HashType ht); HashSink(const HashSink & h); ~HashSink(); - void write(const unsigned char * data, size_t len); - HashResult finish(); + void write(const unsigned char * data, size_t len) override; + HashResult finish() override; HashResult currentHash(); }; |