MPQC  3.0.0-alpha
sc::FileOperationFailed Class Reference

This is thrown when an operation on a file fails. More...

#include <util/misc/scexception.h>

Inheritance diagram for sc::FileOperationFailed:
sc::SystemException sc::SCException sc::Exception

Public Types

enum  FileOperation {
  Unknown, OpenR, OpenW, OpenRW,
  Close, Read, Write, Corrupt,
  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 ClassDesc *class_desc=0, const char *exception_type="FileOperationFailed") MPQC__NOEXCEPT
 Create a FileOperationFailure exception. More...
 
 FileOperationFailed (const FileOperationFailed &) MPQC__NOEXCEPT
 
const char * filename () const MPQC__NOEXCEPT
 Returns the file name of the file that caused the error, if known. More...
 
FileOperation operation () const MPQC__NOEXCEPT
 Return the file operation that failed as a FileOperation enum.
 
- Public Member Functions inherited from sc::SystemException
 SystemException (const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="SystemException") MPQC__NOEXCEPT
 Create a SystemException exception. More...
 
 SystemException (const SystemException &) MPQC__NOEXCEPT
 
- Public Member Functions inherited from sc::SCException
 SCException (const char *description=0, const char *file=0, int line=0, const ClassDesc *class_desc=0, const char *exception_type="SCException") MPQC__NOEXCEPT
 Create an SCException. More...
 
 SCException (const SCException &) MPQC__NOEXCEPT
 
const char * what () const MPQC__NOEXCEPT
 overload of Exception::what()
 
const ClassDescclass_desc () const MPQC__NOEXCEPT
 Returns the class descriptor of the object which generated the exception. More...
 
const char * exception_type () const MPQC__NOEXCEPT
 Returns the classname of the exception. May return null.
 
std::ostream & elaborate ()
 Returns a stream where additional information about the exception can be written. More...
 
- Public Member Functions inherited from sc::Exception
 Exception (const char *description=0, const char *file=0, int line=0) MPQC__NOEXCEPT
 Create an Exception. More...
 
 Exception (const Exception &) MPQC__NOEXCEPT
 
const char * description () const MPQC__NOEXCEPT
 Reimplementation of std::exception::what(). More...
 
const char * file () const MPQC__NOEXCEPT
 Returns the name of the file in which the exception was created. More...
 
int line () const MPQC__NOEXCEPT
 Returns the line number where the exception was created. More...
 

Detailed Description

This is thrown when an operation on a file fails.

Constructor & Destructor Documentation

◆ FileOperationFailed()

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

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.
class_descthe ClassDesc for the object causing the exception.
exception_typethe classname of the SCException specialization. The default is "FileOperationFailure".

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

Member Function Documentation

◆ filename()

const char* sc::FileOperationFailed::filename ( ) const
inline

Returns the file name of the file that caused the error, if known.

Otherwise 0 is returned.


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

Generated at Sun Jan 26 2020 23:24:05 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.