aboutsummaryrefslogtreecommitdiff
path: root/libbutl/sha256.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/sha256.cxx')
-rw-r--r--libbutl/sha256.cxx44
1 files changed, 8 insertions, 36 deletions
diff --git a/libbutl/sha256.cxx b/libbutl/sha256.cxx
index 2528693..95987ec 100644
--- a/libbutl/sha256.cxx
+++ b/libbutl/sha256.cxx
@@ -1,9 +1,7 @@
// file : libbutl/sha256.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
-#ifndef __cpp_modules_ts
-#include <libbutl/sha256.mxx>
-#endif
+#include <libbutl/sha256.hxx>
// C interface for sha256c.
//
@@ -26,39 +24,13 @@ extern "C"
#include "sha256c.c"
}
-#include <cassert>
-
-#ifndef __cpp_lib_modules_ts
-#include <string>
-#include <cstddef>
-#include <cstdint>
-
#include <cctype> // isxdigit()
+#include <cassert>
+#include <istream>
#include <stdexcept> // invalid_argument
-#endif
-
-// Other includes.
-
-#ifdef __cpp_modules_ts
-module butl.sha256;
-
-// Only imports additional to interface.
-#ifdef __cpp_lib_modules_ts
-import std.io;
-#endif
-
-#ifdef __clang__
-#ifdef __cpp_lib_modules_ts
-import std.core;
-#endif
-#endif
-import butl.utility; // *case()
-import butl.fdstream;
-#else
-#include <libbutl/utility.mxx>
-#include <libbutl/fdstream.mxx>
-#endif
+#include <libbutl/utility.hxx> // *case()
+#include <libbutl/bufstreambuf.hxx>
using namespace std;
@@ -85,12 +57,12 @@ namespace butl
}
void sha256::
- append (ifdstream& is)
+ append (istream& is)
{
- fdbuf* buf (dynamic_cast<fdbuf*> (is.rdbuf ()));
+ bufstreambuf* buf (dynamic_cast<bufstreambuf*> (is.rdbuf ()));
assert (buf != nullptr);
- while (is.peek () != ifdstream::traits_type::eof () && is.good ())
+ while (is.peek () != istream::traits_type::eof () && is.good ())
{
size_t n (buf->egptr () - buf->gptr ());
append (buf->gptr (), n);