bit7z 4.1.0
A C++ library for interfacing with the 7-zip shared libs.
Loading...
Searching...
No Matches
BitIndicesView Class Referencefinal

A non-owning, read-only view over a contiguous sequence of archive item indices. More...

#include <bit7z/bitindicesview.hpp>

Public Member Functions

constexpr BitIndicesView () noexcept
 Constructs an empty BitIndicesView.
 BitIndicesView (const IndicesVector &indices) noexcept
 Constructs a BitIndicesView referencing the indices stored in the given vector.
template<typename U, std::size_t N, typename = typename std::enable_if< std::is_convertible< U(*)[ ], element_type(*)[ ] >::value >::type>
constexpr BitIndicesView (const std::array< U, N > &indices) noexcept
 Constructs a BitIndicesView referencing the indices stored in the given std::array.
constexpr BitIndicesView (const_reference index) noexcept
 Constructs a BitIndicesView referencing a single index.
template<std::size_t N>
constexpr BitIndicesView (element_type(&indices)[N]) noexcept
 Constructs a BitIndicesView referencing the indices stored in the given C array.
 BitIndicesView (std::initializer_list< value_type > indices) noexcept
 Constructs a BitIndicesView referencing the indices in the given initializer list.
constexpr auto begin () const noexcept -> iterator
constexpr auto cbegin () const noexcept -> const_iterator
constexpr auto cend () const noexcept -> const_iterator
constexpr auto data () const noexcept -> const_pointer
constexpr auto empty () const noexcept -> bool
constexpr auto end () const noexcept -> iterator
constexpr auto size () const noexcept -> size_type

Detailed Description

A non-owning, read-only view over a contiguous sequence of archive item indices.

BitIndicesView is essentially a C++11-compatible equivalent of std::span< const std::uint32_t >. It implicitly converts from the most common index containers (a single index, an IndicesVector, a C array, a std::array, or an initializer list), so that the extraction and testing methods can accept any of them through a single parameter type.

Constructor & Destructor Documentation

◆ BitIndicesView() [1/6]

BitIndicesView ( )
inlineconstexprnoexcept

Constructs an empty BitIndicesView.

◆ BitIndicesView() [2/6]

BitIndicesView ( const_reference index)
inlineconstexprnoexcept

Constructs a BitIndicesView referencing a single index.

Parameters
indexthe single index to be viewed.

◆ BitIndicesView() [3/6]

BitIndicesView ( const IndicesVector & indices)
inlinenoexcept

Constructs a BitIndicesView referencing the indices stored in the given vector.

Note
This constructor can't be constexpr until C++20 due to std::vector's methods.
Parameters
indicesthe vector of indices to be viewed.

◆ BitIndicesView() [4/6]

template<std::size_t N>
BitIndicesView ( element_type(&) indices[N])
inlineconstexprnoexcept

Constructs a BitIndicesView referencing the indices stored in the given C array.

Template Parameters
Nthe number of indices in the array.
Parameters
indicesthe array of indices to be viewed.

◆ BitIndicesView() [5/6]

template<typename U, std::size_t N, typename = typename std::enable_if< std::is_convertible< U(*)[ ], element_type(*)[ ] >::value >::type>
BitIndicesView ( const std::array< U, N > & indices)
inlineconstexprnoexcept

Constructs a BitIndicesView referencing the indices stored in the given std::array.

Template Parameters
Uthe element type of the array (must be convertible to the view's element type).
Nthe number of indices in the array.
Parameters
indicesthe array of indices to be viewed.

◆ BitIndicesView() [6/6]

BitIndicesView ( std::initializer_list< value_type > indices)
inlinenoexcept

Constructs a BitIndicesView referencing the indices in the given initializer list.

Parameters
indicesthe initializer list of indices to be viewed.

Member Function Documentation

◆ begin()

auto begin ( ) const -> iterator
inlineconstexprnoexcept
Returns
an iterator to the beginning of the viewed indices.

◆ cbegin()

auto cbegin ( ) const -> const_iterator
inlineconstexprnoexcept
Returns
a const iterator to the beginning of the viewed indices.

◆ cend()

auto cend ( ) const -> const_iterator
inlineconstexprnoexcept
Returns
a const iterator to the end of the viewed indices.

◆ data()

auto data ( ) const -> const_pointer
inlineconstexprnoexcept
Returns
a pointer to the beginning of the viewed indices.

◆ empty()

auto empty ( ) const -> bool
inlineconstexprnoexcept
Returns
true if and only if the view does not reference any index.

◆ end()

auto end ( ) const -> iterator
inlineconstexprnoexcept
Returns
an iterator to the end of the viewed indices.

◆ size()

auto size ( ) const -> size_type
inlineconstexprnoexcept
Returns
the number of viewed indices.

The documentation for this class was generated from the following file: