StormByte C++ Library: System module 1.0.1.9999
StormByte-System is the C++26 process and environment module of the StormByte suite.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
StormByte::System::FileIOError Class Referencefinal

A file could not be opened for read or write. More...

#include <exception.hxx>

Inheritance diagram for StormByte::System::FileIOError:
Inheritance graph
[legend]
Collaboration diagram for StormByte::System::FileIOError:
Collaboration graph
[legend]

Public Types

enum class  Operation { Read = 0 , Write }
 Failed file operation. More...
 

Public Member Functions

 FileIOError (const std::filesystem::path &file, const Operation &operation)
 Construct from a path and an operation.
 
 FileIOError (const FileIOError &)=default
 Copy constructor.
 
 FileIOError (FileIOError &&) noexcept=default
 Move constructor.
 
FileIOErroroperator= (const FileIOError &)=default
 Copy assignment.
 
FileIOErroroperator= (FileIOError &&)=default
 Move assignment.
 
 ~FileIOError () noexcept override=default
 Destructor.
 
- Public Member Functions inherited from StormByte::System::Exception
 Exception (const std::string &message)
 Construct from a message.
 
 Exception (const Exception &)=default
 Copy constructor.
 
 Exception (Exception &&) noexcept=default
 Move constructor.
 
Exceptionoperator= (const Exception &)=default
 Copy assignment.
 
Exceptionoperator= (Exception &&) noexcept=default
 Move assignment.
 
virtual ~Exception () noexcept override=default
 Destructor.
 

Static Public Member Functions

static constexpr const char * operation_to_string (const Operation &op) noexcept
 Operation as text.
 

Detailed Description

A file could not be opened for read or write.

Member Enumeration Documentation

◆ Operation

Failed file operation.

Enumerator
Read 

Open for reading.

Write 

Open for writing.

Constructor & Destructor Documentation

◆ FileIOError()

StormByte::System::FileIOError::FileIOError ( const std::filesystem::path &  file,
const Operation operation 
)

Construct from a path and an operation.

Parameters
fileFile path.
operationFailed operation.

Member Function Documentation

◆ operation_to_string()

static constexpr const char * StormByte::System::FileIOError::operation_to_string ( const Operation op)
inlinestaticconstexprnoexcept

Operation as text.

Parameters
opOperation.
Returns
"read", "write", or "unknown".

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