2009-08-24 06:02:06 +02:00
|
|
|
//===--- raw_os_ostream.cpp - Implement the raw_os_ostream class ----------===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2009-08-24 06:02:06 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This implements support adapting raw_ostream to std::ostream.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "llvm/Support/raw_os_ostream.h"
|
|
|
|
#include <ostream>
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// raw_os_ostream
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
raw_os_ostream::~raw_os_ostream() {
|
|
|
|
flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
void raw_os_ostream::write_impl(const char *Ptr, size_t Size) {
|
|
|
|
OS.write(Ptr, Size);
|
|
|
|
}
|
|
|
|
|
2009-12-19 02:38:42 +01:00
|
|
|
uint64_t raw_os_ostream::current_pos() const { return OS.tellp(); }
|