Pasha Bibko Util Library
Loading...
Searching...
No Matches
FileReadError Struct Referencefinal

Error returned when PashaBibko::Util::ReadFile() fails. More...

#include <FileRead.h>

Public Types

enum  Reason { FileNotFound , PermissionDenied , NotAFile }
 Different reasons why the error can occur. More...
 

Public Member Functions

 FileReadError (const std::filesystem::path &_path, Reason _reason)
 

Static Public Member Functions

static const char *const ReasonStr (Reason reason)
 Converts a FileReadError::Reason into a relevant c-string.
 

Public Attributes

const std::filesystem::path path
 Absolute file path of the error.
 
const Reason reason
 Why the file read failed.
 

Detailed Description

Error returned when PashaBibko::Util::ReadFile() fails.

Contains the absolute path of the file that was attempted to read as well as why the file read failed.

Member Enumeration Documentation

◆ Reason

Different reasons why the error can occur.

Enumerator
FileNotFound 

The file path did not point a file location.

PermissionDenied 

The executable does not have the permissions to read the file.

NotAFile 

The file path pointed to a folder not a file.

Constructor & Destructor Documentation

◆ FileReadError()

FileReadError ( const std::filesystem::path &  _path,
Reason  _reason 
)
Parameters
_pathThe absolute file path that was tried to read from.
_reasonWhy the file read failed.

Member Function Documentation

◆ ReasonStr()

static const char *const ReasonStr ( Reason  reason)
static

Converts a FileReadError::Reason into a relevant c-string.

Member Data Documentation

◆ path

const std::filesystem::path path

Absolute file path of the error.

◆ reason

const Reason reason

Why the file read failed.


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