arcsdec::v_1_0_0::FileReadException class final

Reports an error while reading a file.

This exception reports that the file does not exist or is not readable or another IO related error occurred while reading the file content.

A FileReadException may optionally report the byte position of the error. A negative value indicates that no position is known.

Constructors, destructors, conversion operators

FileReadException(const std::string& what_arg) explicit
Constructor.
FileReadException(const std::string& what_arg, const int64_t& byte_pos)
Constructor.

Public functions

auto byte_pos() const -> int64_t
Byte position on which the error occurred.

Function documentation

arcsdec::v_1_0_0::FileReadException::FileReadException(const std::string& what_arg) explicit

Constructor.

Parameters
what_arg in What argument

arcsdec::v_1_0_0::FileReadException::FileReadException(const std::string& what_arg, const int64_t& byte_pos)

Constructor.

Parameters
what_arg in What argument
byte_pos in Byte position of the error

The byte position marks the byte on which the first error occurred.

int64_t arcsdec::v_1_0_0::FileReadException::byte_pos() const

Byte position on which the error occurred.

Returns Byte position on which the error occurred.

This entails that byte_pos - 1 bytes have been read without error.

A negative return value if the position is not known.