mpqc::FileOperationFailed Class Reference
Collaboration diagram for mpqc::FileOperationFailed:

Documentation

This is thrown when an operation on a file fails.

Public Types

enum  FileOperation {
  Unknown, Exists, OpenR, OpenW,
  OpenRW, Close, Read, Write,
  Corrupt, Chdir, Other
}
 

Public Member Functions

 FileOperationFailed (const char *description=0, const char *source_file=0, int line=0, const char *filename=0, FileOperation operation=Unknown, const char *exception_type="FileOperationFailed") noexcept
 
 FileOperationFailed (const FileOperationFailed &) noexcept
 
 FileOperationFailed (FileOperationFailed &&)=default
 
virtual ~FileOperationFailed ()=default
 
const char * filename () const noexcept
 
FileOperation operation () const noexcept
 Return the file operation that failed as a FileOperation enum. More...
 
- Public Member Functions inherited from mpqc::SystemException
 SystemException (const char *description=0, const char *file=0, int line=0, const char *exception_type="SystemException") noexcept
 
 SystemException (const SystemException &)=default
 
 SystemException (SystemException &&)=default
 
virtual ~SystemException ()=default
 
- Public Member Functions inherited from mpqc::Exception
 Exception (const char *description=0, const char *file=0, int line=0, const char *exception_type="Exception") noexcept
 
 Exception (const Exception &) noexcept
 
 Exception (Exception &&)=default
 
virtual ~Exception () noexcept
 
const char * what () const noexcept
 overload of Exception::what() More...
 
const char * exception_type () const noexcept
 Returns the classname of the exception. May return null. More...
 
std::ostream & elaborate ()
 
- Public Member Functions inherited from mpqc::detail::Exception
 Exception (const char *description=0, const char *file=0, int line=0) noexcept
 
 Exception (const Exception &)=default
 
 Exception (Exception &&)=default
 
const char * description () const noexcept
 
const char * file () const noexcept
 
int line () const noexcept
 

Member Enumeration Documentation

◆ FileOperation

Enumerator
Unknown 
Exists 
OpenR 
OpenW 
OpenRW 
Close 
Read 
Write 
Corrupt 
Chdir 
Other 

Constructor & Destructor Documentation

◆ FileOperationFailed() [1/3]

FileOperationFailed::FileOperationFailed ( const char *  description = 0,
const char *  source_file = 0,
int  line = 0,
const char *  filename = 0,
FileOperation  operation = Unknown,
const char *  exception_type = "FileOperationFailed" 
)
noexcept

Create a FileOperationFailure exception.

Parameters
descriptiona description of the problem.
source_filethe file name where the problem occured.
linethe line number where the exception occured.
filenamethe name of the file for which the operation failed.
operationthe type of fail operation that resulted in the failure.
exception_typethe classname of the Exception specialization. The default is "FileOperationFailure".

It is suggested that the special macros FILE and LINE be given as the file and line arguments, respectively.

◆ FileOperationFailed() [2/3]

FileOperationFailed::FileOperationFailed ( const FileOperationFailed other)
noexcept

◆ FileOperationFailed() [3/3]

mpqc::FileOperationFailed::FileOperationFailed ( FileOperationFailed &&  )
default

◆ ~FileOperationFailed()

virtual mpqc::FileOperationFailed::~FileOperationFailed ( )
virtualdefault

Member Function Documentation

◆ filename()

const char* mpqc::FileOperationFailed::filename ( ) const
inlinenoexcept

Returns the file name of the file that caused the error, if known. Otherwise 0 is returned.

◆ operation()

FileOperation mpqc::FileOperationFailed::operation ( ) const
inlinenoexcept

Return the file operation that failed as a FileOperation enum.


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