ReXGlue SDK
Loading...
Searching...
No Matches
file_system_error.h File Reference
#include <string>
#include <utility>
#include <rex/result.h>
#include <rex/types.h>

Go to the source code of this file.

Namespaces

namespace  rex

Enumerations

enum class  rex::filesystem::FileSystemError : u8 {
  kNone = 0 , kNotFound , kPathNotFound , kExists ,
  kIsDirectory , kNotDirectory , kAccessDenied , kEndOfFile ,
  kUnsupported , kNoMount , kMountExists , kInvalidPath ,
  kCorrupt , kIO , kSharingViolation , kNotSameDevice
}

Functions

rex::Error rex::filesystem::BuildError (FileSystemError code, std::string message)
FileSystemError rex::filesystem::CodeOf (const rex::Error &error)

Detailed Description

License
BSD 3-Clause License See LICENSE file in the project root for full license text.

Enumeration Type Documentation

◆ FileSystemError

enum class rex::filesystem::FileSystemError : u8
strong

Filesystem error codes, stored in rex::Error::code.

Enumerator
kNotFound 

The last component of the path does not exist.

kPathNotFound 

A folder before the last component does not exist or is a file.

kEndOfFile 

A read started at or past the end of the file.

kInvalidPath 

The path is malformed or escapes its root.

kSharingViolation 

Another open handle holds the file with sharing that refuses the open.

kNotSameDevice 

A move names a path on another mount.

Function Documentation

◆ BuildError()

rex::Error rex::filesystem::BuildError ( FileSystemError code,
std::string message )
inlinenodiscard

Builds a rex::Error that carries a filesystem code.

Returns
The error. kNotFound, kPathNotFound and kNoMount map to NotFound, kCorrupt to Format, kUnsupported to NotImplemented, the rest to IO.