WPILibC++ 2023.4.3-108-ge5452e3
raw_os_ostream.h
Go to the documentation of this file.
1//===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the raw_os_ostream class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef WPIUTIL_WPI_RAW_OS_OSTREAM_H
14#define WPIUTIL_WPI_RAW_OS_OSTREAM_H
15
16#include "wpi/raw_ostream.h"
17#include <iosfwd>
18
19namespace wpi {
20
21/// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
22/// simple adaptor class. It does not check for output errors; clients should
23/// use the underlying stream to detect errors.
25 std::ostream &OS;
26
27 /// write_impl - See raw_ostream::write_impl.
28 void write_impl(const char *Ptr, size_t Size) override;
29
30 /// current_pos - Return the current position within the stream, not
31 /// counting the bytes currently in the buffer.
32 uint64_t current_pos() const override;
33
34public:
35 raw_os_ostream(std::ostream &O) : OS(O) {}
36 ~raw_os_ostream() override;
37};
38
39} // end wpi namespace
40
41#endif
raw_os_ostream - A raw_ostream that writes to an std::ostream.
Definition: raw_os_ostream.h:24
raw_os_ostream(std::ostream &O)
Definition: raw_os_ostream.h:35
~raw_os_ostream() override
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:44
::uint64_t uint64_t
Definition: Meta.h:58
Definition: AprilTagFieldLayout.h:18