class data_io_stream


template <
    typename IOResource
>
class data_io_stream
    : public data_input_stream<IOResource>
    , public data_output_stream<IOResource>

Description

A data I/O stream is an object that allows you to read and write binary data from/to an I/O resource.

Public Aliases

using referenced_resource_type = IOResource

The type of the referenced I/O resource.

Public Member Functions

explicit
data_io_stream (
    referenced_resource_type& resource,
    std::endian endianness = std::endian::big
)
noexcept

Constructs a data I/O stream from the given I/O resource and with the given endianness. The data I/O stream will hold a non-owning reference to the resource, which is expected to stay valid when using the data I/O stream.

Parameters:
  • resource:

    The I/O resource to read from and write to.

  • endianness:

    The endianness that the data is expected to be in.

data_io_stream (
    const data_io_stream& other
)

Copy-constructs a data_io_stream from an existing one.

Parameters:
  • other:

    The data_io_stream to copy from.

data_io_stream&
operator = (
    const data_io_stream& other
)

Copy-assigns a data_io_stream into this one.

Parameters:
  • other:

    The data_io_stream to copy from.

data_io_stream (
    data_io_stream&& other
)
noexcept

Move-constructs a data_io_stream from an existing one.

Parameters:
  • other:

    The data_io_stream to move from.

data_io_stream&
operator = (
    data_io_stream&& other
)
noexcept

Move-assigns a data_io_stream into this one.

Parameters:
  • other:

    The data_io_stream to move from.

referenced_resource_type*
operator -> ()
const noexcept

Returns a pointer to the referenced I/O resource, enabling use of the arrow operator.



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 2023.