class text_output_stream


template <
    typename OutputResource
>
class text_output_stream
    : public output_stream<OutputResource>

Public Aliases

using wrapped_resource_type = OutputResource

The type of the wrapped output resource.

Public Member Functions

text_output_stream (
    wrapped_resource_type& resource,
    encoding_form target_encoding_form,
    std::endian endianness = std::endian::big,
    flush_strategy fs = flush_strategy::manual
)
noexcept

Constructs a text output stream from the given output resource and with the given encoding form, endianness and flush strategy. The text output stream will hold a non-owning reference to the resource, which is expected to stay valid when using the text output stream.

Parameters:
  • resource:

    The output resource to write to.

  • target_encoding_form:

    The encoding form that the text is going to be in.

  • endianness:

    The endianness that the text is going to be in.

  • fs:

    The flush strategy to use.

encoding_form
get_encoding_form ()
const noexcept

Returns the encoding form associated with this text output stream.

void
set_encoding_form (
    encoding_form new_target_encoding_form
)
noexcept

Sets the encoding form associated with this text output stream.

Parameters:
  • new_target_encoding_form:

    The new encoding form to use with this text output stream.

void
write_bom ()

Writes a BOM (byte order mark) for the current endianness in the current encoding form.



Copyright © 2022-2025 Daniel T. McGinnis

CCL was first published in 2022, and is still actively maintained.

This website was first published in 2022, and is still actively maintained.

This specific web page was first published in 2022.