// SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann #pragma once #include "OutputStream.hxx" #include "util/SpanCast.hxx" #include class StringOutputStream final : public OutputStream { std::string value; public: const std::string &GetValue() const & noexcept { return value; } std::string &&GetValue() && noexcept { return std::move(value); } /* virtual methods from class OutputStream */ void Write(std::span src) override { value.append(ToStringView(src)); } };