virtual uint64_t current_pos();
public:
- raw_os_ostream(std::ostream &O) : OS(O) {}
- ~raw_os_ostream();
+ raw_os_ostream(std::ostream &O) : raw_ostream(true), OS(O) {}
/// tell - Return the current offset with the stream.
uint64_t tell();
/// counting the bytes currently in the buffer.
virtual uint64_t current_pos() { return OS.size(); }
public:
- explicit raw_string_ostream(std::string &O) : OS(O) {}
- ~raw_string_ostream();
+ explicit raw_string_ostream(std::string &O) : raw_ostream(true), OS(O) {}
/// tell - Return the current offset with the stream.
uint64_t tell() { return OS.size() + GetNumBytesInBuffer(); }
/// counting the bytes currently in the buffer.
virtual uint64_t current_pos();
public:
- explicit raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {}
- ~raw_svector_ostream();
+ explicit raw_svector_ostream(SmallVectorImpl<char> &O)
+ : raw_ostream(true), OS(O) {}
/// tell - Return the current offset with the stream.
uint64_t tell();
// 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);
}
// raw_string_ostream
//===----------------------------------------------------------------------===//
-raw_string_ostream::~raw_string_ostream() {
- flush();
-}
-
void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
OS.append(Ptr, Size);
}
// raw_svector_ostream
//===----------------------------------------------------------------------===//
-raw_svector_ostream::~raw_svector_ostream() {
- flush();
-}
-
void raw_svector_ostream::write_impl(const char *Ptr, size_t Size) {
OS.append(Ptr, Ptr + Size);
}