10#include <botan/data_snk.h>
12#include <botan/exceptn.h>
13#include <botan/mem_ops.h>
14#include <botan/internal/fmt.h>
17#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
29 throw Stream_IO_Error(
"DataSink_Stream: Failure writing to " + m_identifier);
45#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
52 m_sink_memory(std::make_unique<std::ofstream>(std::string(path), use_binary ? std::ios::binary : std::ios::out)),
53 m_sink(*m_sink_memory) {
55 throw Stream_IO_Error(fmt(
"DataSink_Stream: Failure opening path '{}'", path));
void write(const uint8_t[], size_t) override
DataSink_Stream(std::ostream &stream, std::string_view name="<std::ostream>")
~DataSink_Stream() override
const char * cast_uint8_ptr_to_char(const uint8_t *b)