1
//===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
3
// The LLVM Compiler Infrastructure
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
8
//===----------------------------------------------------------------------===//
10
// This file defines the raw_os_ostream class.
12
//===----------------------------------------------------------------------===//
14
#ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
15
#define LLVM_SUPPORT_RAW_OS_OSTREAM_H
17
#include "llvm/Support/raw_ostream.h"
22
/// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
23
/// simple adaptor class. It does not check for output errors; clients should
24
/// use the underlying stream to detect errors.
25
class raw_os_ostream : public raw_ostream {
28
/// write_impl - See raw_ostream::write_impl.
29
virtual void write_impl(const char *Ptr, size_t Size);
31
/// current_pos - Return the current position within the stream, not
32
/// counting the bytes currently in the buffer.
33
virtual uint64_t current_pos() const;
36
raw_os_ostream(std::ostream &O) : OS(O) {}
40
} // end llvm namespace