Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:33

0001 //===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines the raw_os_ostream class.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
0014 #define LLVM_SUPPORT_RAW_OS_OSTREAM_H
0015 
0016 #include "llvm/Support/raw_ostream.h"
0017 #include <iosfwd>
0018 
0019 namespace llvm {
0020 
0021 /// raw_os_ostream - A raw_ostream that writes to an std::ostream.  This is a
0022 /// simple adaptor class.  It does not check for output errors; clients should
0023 /// use the underlying stream to detect errors.
0024 class raw_os_ostream : public raw_ostream {
0025   std::ostream &OS;
0026 
0027   /// write_impl - See raw_ostream::write_impl.
0028   void write_impl(const char *Ptr, size_t Size) override;
0029 
0030   /// current_pos - Return the current position within the stream, not
0031   /// counting the bytes currently in the buffer.
0032   uint64_t current_pos() const override;
0033 
0034 public:
0035   raw_os_ostream(std::ostream &O) : OS(O) {}
0036   ~raw_os_ostream() override;
0037 };
0038 
0039 } // end llvm namespace
0040 
0041 #endif