3#include <classes/ReturnVal.h>
44 const std::filesystem::path
path;
ReturnVal< std::string, FileReadError > ReadFile(const std::filesystem::path &path)
Reads a file to a string.
StringLocation GetLocationAtStringIndex(const std::string &string, uint32_t index)
Finds the location of [colummn, line] of a given index.
Error returned when PashaBibko::Util::ReadFile() fails.
Definition FileRead.h:24
const Reason reason
Why the file read failed.
Definition FileRead.h:49
FileReadError(const std::filesystem::path &_path, Reason _reason)
const std::filesystem::path path
Absolute file path of the error.
Definition FileRead.h:44
static const char *const ReasonStr(Reason reason)
Converts a FileReadError::Reason into a relevant c-string.
Reason
Different reasons why the error can occur.
Definition FileRead.h:29
@ FileNotFound
The file path did not point a file location.
Definition FileRead.h:30
@ PermissionDenied
The executable does not have the permissions to read the file.
Definition FileRead.h:31
@ NotAFile
The file path pointed to a folder not a file.
Definition FileRead.h:32
Location within a string.
Definition FileRead.h:74
unsigned short line
Definition FileRead.h:76
unsigned short colummn
Definition FileRead.h:75
Mathmatical vector class.
Definition Vec.h:216