Skip to content

IOError ​

cpp
#include <utlib/include/utl/io/IOError.h>
cpp
struct IOError

Defined in utlib/include/utl/io/IOError.h:21

Exception thrown if a file or folder cannot be accessed.

The error code (see fault()) is one of the constants below. The message returned by what() names the affected file or folder.

Public Methods ​

ReturnNameDescription
const char *errstr virtual const inline noexcept overrideReturns the name of the error code.
IOError inline explicitCreates an error with an error code and the name of the affected file or folder.

errstr ​

virtual const inline noexcept override

cpp
virtual inline const char * errstr() const noexcept override

Defined in utlib/include/utl/io/IOError.h:46

Returns the name of the error code.

Reimplements ​


IOError ​

inline explicit

cpp
inline explicit IOError(long fault, const std::string & msg = "")

Defined in utlib/include/utl/io/IOError.h:78

Creates an error with an error code and the name of the affected file or folder.

Public Static Attributes ​

ReturnNameDescription
longDIR_NOT_FOUND static constexprThe folder does not exist.
longDIR_ACCESS_DENIED static constexprAccess to the folder was denied.
longDIR_CANT_CREATE static constexprThe folder could not be created.
longDIR_CANT_DELETE static constexprThe folder could not be deleted.
longDIR_NOT_EMPTY static constexprThe folder is not empty.
longFILE_NOT_FOUND static constexprThe file does not exist.
longFILE_EXISTS static constexprThe file exists already.
longFILE_IS_DIRECTORY static constexprThe path refers to a folder, not a file.
longFILE_ACCESS_DENIED static constexprAccess to the file was denied.
longFILE_TYPE_MISMATCH static constexprThe file has the wrong type.
longFILE_TYPE_UNSUPPORTED static constexprThe file type is not supported.
longFILE_CANT_READ static constexprThe file could not be read.
longFILE_CANT_WRITE static constexprThe file could not be written.
longFILE_CANT_CREATE static constexprThe file could not be created.
longFILE_CANT_DELETE static constexprThe file could not be deleted.
longFILE_INVALID_DATA static constexprThe file contains invalid data.
longFILE_IN_USE static constexprThe file is in use.
longJSON_ERROR static constexprA JSON document could not be processed.
longZLIB_ERROR static constexprCompression or decompression failed.

DIR_NOT_FOUND ​

static constexpr

cpp
long DIR_NOT_FOUND = 0

Defined in utlib/include/utl/io/IOError.h:23

The folder does not exist.


DIR_ACCESS_DENIED ​

static constexpr

cpp
long DIR_ACCESS_DENIED = 1

Defined in utlib/include/utl/io/IOError.h:24

Access to the folder was denied.


DIR_CANT_CREATE ​

static constexpr

cpp
long DIR_CANT_CREATE = 2

Defined in utlib/include/utl/io/IOError.h:25

The folder could not be created.


DIR_CANT_DELETE ​

static constexpr

cpp
long DIR_CANT_DELETE = 3

Defined in utlib/include/utl/io/IOError.h:26

The folder could not be deleted.


DIR_NOT_EMPTY ​

static constexpr

cpp
long DIR_NOT_EMPTY = 4

Defined in utlib/include/utl/io/IOError.h:27

The folder is not empty.


FILE_NOT_FOUND ​

static constexpr

cpp
long FILE_NOT_FOUND = 10

Defined in utlib/include/utl/io/IOError.h:29

The file does not exist.


FILE_EXISTS ​

static constexpr

cpp
long FILE_EXISTS = 11

Defined in utlib/include/utl/io/IOError.h:30

The file exists already.


FILE_IS_DIRECTORY ​

static constexpr

cpp
long FILE_IS_DIRECTORY = 12

Defined in utlib/include/utl/io/IOError.h:31

The path refers to a folder, not a file.


FILE_ACCESS_DENIED ​

static constexpr

cpp
long FILE_ACCESS_DENIED = 13

Defined in utlib/include/utl/io/IOError.h:32

Access to the file was denied.


FILE_TYPE_MISMATCH ​

static constexpr

cpp
long FILE_TYPE_MISMATCH = 14

Defined in utlib/include/utl/io/IOError.h:33

The file has the wrong type.


FILE_TYPE_UNSUPPORTED ​

static constexpr

cpp
long FILE_TYPE_UNSUPPORTED = 15

Defined in utlib/include/utl/io/IOError.h:34

The file type is not supported.


FILE_CANT_READ ​

static constexpr

cpp
long FILE_CANT_READ = 16

Defined in utlib/include/utl/io/IOError.h:35

The file could not be read.


FILE_CANT_WRITE ​

static constexpr

cpp
long FILE_CANT_WRITE = 17

Defined in utlib/include/utl/io/IOError.h:36

The file could not be written.


FILE_CANT_CREATE ​

static constexpr

cpp
long FILE_CANT_CREATE = 18

Defined in utlib/include/utl/io/IOError.h:37

The file could not be created.


FILE_CANT_DELETE ​

static constexpr

cpp
long FILE_CANT_DELETE = 19

Defined in utlib/include/utl/io/IOError.h:38

The file could not be deleted.


FILE_INVALID_DATA ​

static constexpr

cpp
long FILE_INVALID_DATA = 20

Defined in utlib/include/utl/io/IOError.h:39

The file contains invalid data.


FILE_IN_USE ​

static constexpr

cpp
long FILE_IN_USE = 21

Defined in utlib/include/utl/io/IOError.h:40

The file is in use.


JSON_ERROR ​

static constexpr

cpp
long JSON_ERROR = 30

Defined in utlib/include/utl/io/IOError.h:42

A JSON document could not be processed.


ZLIB_ERROR ​

static constexpr

cpp
long ZLIB_ERROR = 31

Defined in utlib/include/utl/io/IOError.h:43

Compression or decompression failed.