template<class Container>
binary_io::components::basic_memory_stream_base class

Implements the common interface of every memory_stream.

Base classes

class basic_seek_stream
Implements the basic seeking methods required for every stream.

Derived classes

template<class Container>
class binary_io::basic_memory_istream final
A stream which composes a dynamically sized container.
template<class Container>
class binary_io::basic_memory_ostream final
A stream which composes a dynamically sized container.

Public types

using container_type = Container

Constructors, destructors, conversion operators

basic_memory_stream_base() defaulted
Default constructs the underlying buffer.
basic_memory_stream_base(const container_type& a_container) noexcept(…)
Copy constructs the underlying buffer.
basic_memory_stream_base(container_type&& a_container) noexcept(…)
Move constructs the underlying buffer.
template<class... Args>
basic_memory_stream_base(std::in_place_t, Args && ... a_args) noexcept(…)
Constructs the underlying buffer, in-place, using the given args.

Buffer management

auto rdbuf() -> container_type& noexcept
Provides mutable access to the underlying buffer.
auto rdbuf() const -> const container_type& noexcept
Provides immutable access to the underlying buffer.

Position

void seek_absolute(binary_io::streamoff a_pos) noexcept
Seek to an absolute position in the stream (i.e. from the beginning).
void seek_relative(binary_io::streamoff a_off) noexcept
Seek to a position in the stream relative to the current position.
auto tell() const -> binary_io::streamoff noexcept
Gets the current stream position.

Function documentation

template<class Container>
binary_io::components::basic_memory_stream_base<Container>::basic_memory_stream_base(const container_type& a_container) noexcept(…)

Copy constructs the underlying buffer.

Parameters
a_container The container to copy from.

template<class Container>
binary_io::components::basic_memory_stream_base<Container>::basic_memory_stream_base(container_type&& a_container) noexcept(…)

Move constructs the underlying buffer.

Parameters
a_container The container to move from.

template<class Container>
template<class... Args>
binary_io::components::basic_memory_stream_base<Container>::basic_memory_stream_base(std::in_place_t, Args && ... a_args) noexcept(…)

Constructs the underlying buffer, in-place, using the given args.

Parameters
a_args The args to construct the buffer with.

template<class Container>
container_type& binary_io::components::basic_memory_stream_base<Container>::rdbuf() noexcept

Provides mutable access to the underlying buffer.

Returns The underlying buffer.

template<class Container>
const container_type& binary_io::components::basic_memory_stream_base<Container>::rdbuf() const noexcept

Provides immutable access to the underlying buffer.

Returns The underlying buffer.