This class provides the public-facing const-qualified methods of a slice. More...
#include <slice.hpp>
Public Member Functions | |
ConstSliceBase (data_type &data, size_t begin, size_t end) | |
const value_type & | at (size_t index) const |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
template<typename slice_type > | |
slice_type | subSlice (size_t begin, size_t end) const |
Public Member Functions inherited from Exiv2::Internal::SliceBase | |
SliceBase (size_t begin, size_t end) | |
size_t | size () const noexcept |
Protected Attributes | |
storage_type< data_type > | storage_ |
Protected Attributes inherited from Exiv2::Internal::SliceBase | |
size_t | begin_ |
size_t | end_ |
Additional Inherited Members | |
Protected Member Functions inherited from Exiv2::Internal::SliceBase | |
void | rangeCheck (size_t index) const |
This class provides the public-facing const-qualified methods of a slice.
The public methods are implemented in a generic fashion using a storage_type. This type contains the actual reference to the data to which the slice points and provides the following methods:
begin
& end
to perform range checks on data
, but should not store both values. Must not take ownership of data
!data_
.
|
inline |
Default constructor, requires begin to be smaller than end, otherwise an exception is thrown. Also forwards all parameters to the constructor of storage_
|
inline |
Obtain a constant reference to the element with the specified index in the slice.
std::out_of_range | when index is out of bounds of the slice |
References Exiv2::Internal::SliceBase::begin_, Exiv2::Internal::SliceBase::rangeCheck(), and Exiv2::Internal::ConstSliceBase< storage_type, data_type >::storage_.
|
inlinenoexcept |
Obtain a constant iterator to the first element in the slice.
References Exiv2::Internal::SliceBase::begin_, and Exiv2::Internal::ConstSliceBase< storage_type, data_type >::storage_.
|
inlinenoexcept |
Obtain a constant iterator to the first beyond the slice.
References Exiv2::Internal::ConstSliceBase< storage_type, data_type >::storage_.
|
inline |
Create a constant sub-slice with the given bounds (with respect to the current slice).
slice_type | Type of the slice that this function shall return. Provide it with the type of the class that derives from mutable_slice_base. |
References Exiv2::Internal::SliceBase::begin_, Exiv2::Internal::SliceBase::rangeCheck(), and Exiv2::Internal::ConstSliceBase< storage_type, data_type >::storage_.
|
protected |
Stores a reference to the actual data.
Referenced by Exiv2::Internal::MutableSliceBase< storage_type, data_type >::at(), Exiv2::Internal::ConstSliceBase< storage_type, data_type >::at(), Exiv2::Internal::MutableSliceBase< storage_type, data_type >::begin(), Exiv2::Internal::ConstSliceBase< storage_type, data_type >::cbegin(), Exiv2::Internal::ConstSliceBase< storage_type, data_type >::cend(), Exiv2::Internal::MutableSliceBase< storage_type, data_type >::end(), Exiv2::Internal::MutableSliceBase< storage_type, data_type >::subSlice(), Exiv2::Internal::ConstSliceBase< storage_type, data_type >::subSlice(), and Exiv2::Internal::MutableSliceBase< storage_type, data_type >::to_const_base().