Chris Lattner | 0ffe0e0 | 2009-08-24 04:02:06 +0000 | [diff] [blame] | 1 | //===--- raw_os_ostream.cpp - Implement the raw_os_ostream class ----------===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Chris Lattner | 0ffe0e0 | 2009-08-24 04:02:06 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This implements support adapting raw_ostream to std::ostream. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "llvm/Support/raw_os_ostream.h" |
| 14 | #include <ostream> |
| 15 | using namespace llvm; |
| 16 | |
| 17 | //===----------------------------------------------------------------------===// |
| 18 | // raw_os_ostream |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | |
| 21 | raw_os_ostream::~raw_os_ostream() { |
| 22 | flush(); |
| 23 | } |
| 24 | |
| 25 | void raw_os_ostream::write_impl(const char *Ptr, size_t Size) { |
| 26 | OS.write(Ptr, Size); |
| 27 | } |
| 28 | |
Chris Lattner | dd3e9aa | 2009-12-19 01:38:42 +0000 | [diff] [blame] | 29 | uint64_t raw_os_ostream::current_pos() const { return OS.tellp(); } |