[#llvm-raw_ostream_proxy_adaptor-0f] = xref:llvm.adoc[llvm]::raw_ostream_proxy_adaptor :relfileprefix: ../ :mrdocs: Adaptor to create a stream class that proxies another _raw_ostream._ == Synopsis Declared in `<llvm/Support/raw_ostream_proxy.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RawOstreamT = xref:llvm/raw_ostream.adoc[raw_ostream]> class raw_ostream_proxy_adaptor : public RawOstreamT ---- == Description Use _raw_ostream_proxy_adaptor<>_ directly to implement an abstract derived class of _raw_ostream_ as a proxy. Otherwise use _raw_ostream_proxy._ Most operations are forwarded to the proxied stream. If the proxied stream is buffered, the buffer is dropped and moved to this stream. This allows _flush()_ to work correctly, flushing immediately from the proxy through to the final stream, and avoids any wasteful double‐buffering. _enable_colors()_ changes both the proxied stream and the proxy itself. _is_displayed()_ and _has_colors()_ are forwarded to the proxy. _changeColor(),_ resetColor(), and _reverseColor()_ are not forwarded, since they need to call _flush()_ and the buffer lives in the proxy. == Base Classes [cols="1,4"] |=== | Name| Description | `RawOstreamT` | |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/raw_ostream_proxy_adaptor-0f/2destructor.adoc[`~raw_ostream_proxy_adaptor`] [.small]#[destructor]# | Destroy the adaptor and stop proxying the underlying stream. | xref:llvm/raw_ostream_proxy_adaptor-0f/enable_colors.adoc[`enable_colors`] | Enable or disable colors on both this proxy and the proxied stream. | xref:llvm/raw_ostream_proxy_adaptor-0f/getPreferredBufferSize.adoc[`getPreferredBufferSize`] | Return the preferred buffer size cached at construction. | xref:llvm/raw_ostream_proxy_adaptor-0f/getProxiedOS.adoc[`getProxiedOS`] | Return a reference to the proxied stream. | xref:llvm/raw_ostream_proxy_adaptor-0f/hasProxiedOS.adoc[`hasProxiedOS`] | Return true if this adaptor still has a proxied stream. | xref:llvm/raw_ostream_proxy_adaptor-0f/has_colors.adoc[`has_colors`] | Return whether the proxied stream supports colors. | xref:llvm/raw_ostream_proxy_adaptor-0f/is_displayed.adoc[`is_displayed`] | Return whether the proxied stream is connected to a display. | xref:llvm/raw_ostream_proxy_adaptor-0f/reserveExtraSpace.adoc[`reserveExtraSpace`] | Forward a reserve request to the proxied stream. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/raw_ostream_proxy_adaptor-0f/2constructor.adoc[`raw_ostream_proxy_adaptor`] [.small]#[constructor]# | Construct an adaptor that proxies `OS` and forwards base constructor arguments. | xref:llvm/raw_ostream_proxy_adaptor-0f/resetProxiedOS.adoc[`resetProxiedOS`] | Stop proxying the stream. Flush and set up a crash for future writes. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:llvm/raw_ostream_proxy.adoc[`raw_ostream_proxy`] | Non‐owning proxy for a _raw_ostream._ Enables passing a stream into an API that takes ownership. | xref:llvm/raw_pwrite_stream_proxy_adaptor-02.adoc[`raw_pwrite_stream_proxy_adaptor`] | Adaptor for creating a stream that proxies a _raw_pwrite_stream._ |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#