class raw_svector_ostream

Declaration

class raw_svector_ostream : public raw_pwrite_stream { /* full declaration omitted */ };

Description

A raw_ostream that writes to an SmallVector or SmallString. This is a simple adaptor class. This class does not encounter output errors. raw_svector_ostream operates without a buffer, delegating all memory management to the SmallString. Thus the SmallString is always up-to-date, may be used directly and there is no need to call flush().

Declared at: llvm/include/llvm/Support/raw_ostream.h:662

Inherits from: raw_pwrite_stream

Member Variables

private SmallVectorImpl<char>& OS

Inherited from raw_ostream:

public static BLACK = Colors::BLACK
public static RED = Colors::RED
public static GREEN = Colors::GREEN
public static YELLOW = Colors::YELLOW
public static BLUE = Colors::BLUE
public static MAGENTA = Colors::MAGENTA
public static CYAN = Colors::CYAN
public static WHITE = Colors::WHITE
public static SAVEDCOLOR = Colors::SAVEDCOLOR
public static RESET = Colors::RESET

Method Overview

Inherited from raw_pwrite_stream:

Inherited from raw_ostream:

Methods

uint64_t current_pos() const

Description

Return the current position within the stream.

Declared at: llvm/include/llvm/Support/raw_ostream.h:671

void flush()

Declared at: llvm/include/llvm/Support/raw_ostream.h:684

void pwrite_impl(const char* Ptr,
                 size_t Size,
                 uint64_t Offset)

Declared at: llvm/include/llvm/Support/raw_ostream.h:668

Parameters

const char* Ptr
size_t Size
uint64_t Offset

raw_svector_ostream(SmallVectorImpl<char>& O)

Description

Construct a new raw_svector_ostream.

Declared at: llvm/include/llvm/Support/raw_ostream.h:678

Parameters

SmallVectorImpl<char>& O
The vector to write to; this should generally have at least 128 bytes free to avoid any extraneous memory overhead.

void reserveExtraSpace(uint64_t ExtraSize)

Description

If possible, pre-allocate \p ExtraSize bytes for stream data. i.e. it extends internal buffers to keep additional ExtraSize bytes. So that the stream could keep at least tell() + ExtraSize bytes without re-allocations. reserveExtraSpace() does not change the size/data of the stream.

Declared at: llvm/include/llvm/Support/raw_ostream.h:689

Parameters

uint64_t ExtraSize

llvm::StringRef str() const

Description

Return a StringRef for the vector contents.

Declared at: llvm/include/llvm/Support/raw_ostream.h:687

void write_impl(const char* Ptr, size_t Size)

Description

See raw_ostream::write_impl.

Declared at: llvm/include/llvm/Support/raw_ostream.h:666

Parameters

const char* Ptr
size_t Size

~raw_svector_ostream()

Declared at: llvm/include/llvm/Support/raw_ostream.h:682