From 98c4038df36fb73601c58ccd885d1c2d3703cf6e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Sep 2021 08:26:54 +0200 Subject: Factor "buffered streambuf" interface from fdbuf to bufstreambuf Also rename fdbuf to fdstreambuf for consistency. --- libbutl/sha256.mxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libbutl/sha256.mxx') 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 +#include // istream #include // size_t #include #include // 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. // -- cgit v1.1