Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
dxl::MappedFile::Data Class Reference

Description:

A minimal sequential-only cursor over the file data. Enforces the "forward-only" usage pattern in calling code.

Definition at line 50 of file mappedfile.hpp.

#include <mappedfile.hpp>

Public Method Index:

 Data ()
 Defaulted default-constructor.
 Data (const std::byte *pData, std::size_t n)
const std::byte * Current () const noexcept
bool IsEOF () const noexcept
template<typename TCheck = alib::CHK>
std::byte Next ()
template<typename TCheck = alib::CHK>
char operator() ()
std::size_t Remaining () const noexcept
template<typename TCheck = alib::CHK>
void Skip (std::size_t n)

Protected Field Index:

const std::byte * end
 Pointer to the end of the data.
const std::byte * p
 Current pointer position.

Field Details:

◆ end

const std::byte* dxl::MappedFile::Data::end
protected

Pointer to the end of the data.

Definition at line 53 of file mappedfile.hpp.

◆ p

const std::byte* dxl::MappedFile::Data::p
protected

Current pointer position.

Definition at line 52 of file mappedfile.hpp.

Constructor(s) / Destructor Details:

◆ Data() [1/2]

dxl::MappedFile::Data::Data ( )
inline

Defaulted default-constructor.

Definition at line 57 of file mappedfile.hpp.

◆ Data() [2/2]

dxl::MappedFile::Data::Data ( const std::byte * pData,
std::size_t n )
inline

Constructor.

Parameters
pDataPointer to the start of the data.
nSize of the data in bytes.

Definition at line 62 of file mappedfile.hpp.

Method Details:

◆ Current()

const std::byte * dxl::MappedFile::Data::Current ( ) const
inlinenoexcept

Get pointer to current position (read-only).

Returns
Pointer to current position.

Definition at line 106 of file mappedfile.hpp.

◆ IsEOF()

bool dxl::MappedFile::Data::IsEOF ( ) const
inlinenoexcept

True if at end.

Returns
true if the current position reached end, false otherwise.

Definition at line 70 of file mappedfile.hpp.

◆ Next()

template<typename TCheck = alib::CHK>
std::byte dxl::MappedFile::Data::Next ( )
inline

Get the next byte and advance.

Template Parameters
TCheckDefaults to alib::CHK, which is the normal invocation mode. If alib::NC is given, no range check is performed. In debug builds, an assertion is raised if the cursor is at end.
Returns
The byte at current position.

Definition at line 79 of file mappedfile.hpp.

◆ operator()()

template<typename TCheck = alib::CHK>
char dxl::MappedFile::Data::operator() ( )
inline

Get the next byte as a char and advance.

Template Parameters
TCheckDefaults to alib::CHK, which is the normal invocation mode. If alib::NC is given, no range check is performed. In debug builds, an assertion is raised if the cursor is at end.
Returns
The byte at current position.

Definition at line 95 of file mappedfile.hpp.

◆ Remaining()

std::size_t dxl::MappedFile::Data::Remaining ( ) const
inlinenoexcept

Remaining bytes.

Returns
The number of bytes from current position to end.

Definition at line 66 of file mappedfile.hpp.

◆ Skip()

template<typename TCheck = alib::CHK>
void dxl::MappedFile::Data::Skip ( std::size_t n)
inline

Advance by n bytes (must stay within range).

Template Parameters
TCheckDefaults to alib::CHK, which is the normal invocation mode. If alib::NC is given, no range check is performed. In debug builds, an assertion is raised if advancing past end.
Parameters
nNumber of bytes to advance.
Exceptions
std::out_of_rangeif advancing past end and TCheck is alib::CHK.

Definition at line 116 of file mappedfile.hpp.


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