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>
|
| | 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) |
|
| const std::byte * | end |
| | Pointer to the end of the data.
|
| const std::byte * | p |
| | Current pointer position.
|
◆ end
| const std::byte* dxl::MappedFile::Data::end |
|
protected |
| const std::byte* dxl::MappedFile::Data::p |
|
protected |
◆ Data() [1/2]
| dxl::MappedFile::Data::Data |
( |
| ) |
|
|
inline |
◆ Data() [2/2]
| dxl::MappedFile::Data::Data |
( |
const std::byte * | pData, |
|
|
std::size_t | n ) |
|
inline |
Constructor.
- Parameters
-
| pData | Pointer to the start of the data. |
| n | Size of the data in bytes. |
Definition at line 62 of file mappedfile.hpp.
◆ 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
-
| TCheck | Defaults 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
-
| TCheck | Defaults 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
-
| TCheck | Defaults 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
-
| n | Number of bytes to advance. |
- Exceptions
-
| std::out_of_range | if 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: