class raw_string_ostream
Declaration
class raw_string_ostream : public raw_ostream { /* full declaration omitted */ };
Description
A raw_ostream that writes to an std::string. This is a simple adaptor class. This class does not encounter output errors. raw_string_ostream operates without a buffer, delegating all memory management to the std::string. Thus the std::string 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:632
Inherits from: raw_ostream
Member Variables
- private std::string& 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
- private uint64_t current_pos() const
- public raw_string_ostream(std::string & O)
- public void reserveExtraSpace(uint64_t ExtraSize)
- public std::string & str()
- private void write_impl(const char * Ptr, size_t Size)
Inherited from raw_ostream:
- public GetBufferSize
- public GetNumBytesInBuffer
- protected SetBuffer
- public SetBufferSize
- public SetBuffered
- public SetUnbuffered
- public changeColor
- public colors_enabled
- public enable_colors
- public flush
- protected getBufferStart
- public get_kind
- public has_colors
- public indent
- public is_displayed
- protected preferred_buffer_size
- public reserveExtraSpace
- public resetColor
- public reverseColor
- public tell
- public tie
- public write
- public write
- public write_escaped
- public write_hex
- public write_uuid
- public write_zeros
Methods
¶uint64_t current_pos() const
uint64_t current_pos() const
Description
Return the current position within the stream, not counting the bytes currently in the buffer.
Declared at: llvm/include/llvm/Support/raw_ostream.h:640
¶raw_string_ostream(std::string& O)
raw_string_ostream(std::string& O)
Declared at: llvm/include/llvm/Support/raw_ostream.h:643
Parameters
- std::string& O
¶void reserveExtraSpace(uint64_t ExtraSize)
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:652
Parameters
- uint64_t ExtraSize
¶std::string& str()
std::string& str()
Description
Returns the string's reference. In most cases it is better to simply use the underlying std::string directly. TODO: Consider removing this API.
Declared at: llvm/include/llvm/Support/raw_ostream.h:650
¶void write_impl(const char* Ptr, size_t Size)
void write_impl(const char* Ptr, size_t Size)
Description
See raw_ostream::write_impl.
Declared at: llvm/include/llvm/Support/raw_ostream.h:636
Parameters
- const char* Ptr
- size_t Size