2009-08-24 06:02:06 +02:00
|
|
|
//===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the raw_os_ostream class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
|
|
|
|
#define LLVM_SUPPORT_RAW_OS_OSTREAM_H
|
|
|
|
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
/// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
|
|
|
|
/// simple adaptor class. It does not check for output errors; clients should
|
|
|
|
/// use the underlying stream to detect errors.
|
|
|
|
class raw_os_ostream : public raw_ostream {
|
|
|
|
std::ostream &OS;
|
2012-09-23 04:12:10 +02:00
|
|
|
|
2009-08-24 06:02:06 +02:00
|
|
|
/// write_impl - See raw_ostream::write_impl.
|
2014-03-10 04:53:12 +01:00
|
|
|
void write_impl(const char *Ptr, size_t Size) override;
|
2012-09-23 04:12:10 +02:00
|
|
|
|
2009-08-24 06:02:06 +02:00
|
|
|
/// current_pos - Return the current position within the stream, not
|
|
|
|
/// counting the bytes currently in the buffer.
|
2014-03-10 04:53:12 +01:00
|
|
|
uint64_t current_pos() const override;
|
2012-09-23 04:12:10 +02:00
|
|
|
|
2009-08-24 06:02:06 +02:00
|
|
|
public:
|
2015-04-09 17:54:59 +02:00
|
|
|
raw_os_ostream(std::ostream &O) : OS(O) {}
|
2015-04-11 04:11:45 +02:00
|
|
|
~raw_os_ostream() override;
|
2009-08-24 06:02:06 +02:00
|
|
|
};
|
|
|
|
|
2015-06-23 11:49:53 +02:00
|
|
|
} // end llvm namespace
|
2009-08-24 06:02:06 +02:00
|
|
|
|
|
|
|
#endif
|