aboutsummaryrefslogtreecommitdiff
path: root/libbutl/sha256.mxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-09-08 08:26:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-09-08 08:26:54 +0200
commit98c4038df36fb73601c58ccd885d1c2d3703cf6e (patch)
tree627256e1f79a5bcefef72d22cea01bfa490af398 /libbutl/sha256.mxx
parentd7b7fd602b981dd6816b0e5c7c341e2cef272c17 (diff)
Factor "buffered streambuf" interface from fdbuf to bufstreambuf
Also rename fdbuf to fdstreambuf for consistency.
Diffstat (limited to 'libbutl/sha256.mxx')
-rw-r--r--libbutl/sha256.mxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbutl/sha256.mxx b/libbutl/sha256.mxx
index 9bc0971..d5128b1 100644
--- a/libbutl/sha256.mxx
+++ b/libbutl/sha256.mxx
@@ -9,6 +9,7 @@
#ifndef __cpp_lib_modules_ts
#include <string>
+#include <iosfwd> // istream
#include <cstddef> // size_t
#include <cstdint>
#include <cstring> // strlen(), memcpy()
@@ -28,8 +29,6 @@ import std.core;
LIBBUTL_MODEXPORT namespace butl
{
- class ifdstream;
-
// SHA256 checksum calculator.
//
// For a single chunk of data a sum can be obtained in one line, for
@@ -101,11 +100,14 @@ LIBBUTL_MODEXPORT namespace butl
// Append stream.
//
+ // Note that currently the stream is expected to be bufstreambuf-based
+ // (e.g., ifdstream).
+ //
void
- append (ifdstream&);
+ append (std::istream&);
explicit
- sha256 (ifdstream& i): sha256 () {append (i);}
+ sha256 (std::istream& i): sha256 () {append (i);}
// Check if any data has been hashed.
//