// SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann #ifndef STDIO_OUTPUT_STREAM_HXX #define STDIO_OUTPUT_STREAM_HXX #include "OutputStream.hxx" #include class StdioOutputStream final : public OutputStream { FILE *const file; public: explicit StdioOutputStream(FILE *_file) noexcept:file(_file) {} /* virtual methods from class OutputStream */ void Write(std::span src) override { fwrite(src.data(), 1, src.size(), file); /* this class is debug-only and ignores errors */ } }; #endif