NDEVR
API Documentation
FileException

An Exception that contains information about a runtime error with a particular File. More...

Inheritance diagram for FileException:
[legend]
Collaboration diagram for FileException:
[legend]

Public Types

enum  ExceptionType {
  e_generic , e_no_open , e_already_open , e_does_not_exist ,
  e_file_exits , e_file_invalid , e_checksum_failed , e_not_supported ,
  e_no_create
}
 Categorizes the type of file error that occurred. More...

Public Member Functions

 FileException (const File &file, const TranslatedString &message, ExceptionType type=e_generic)
 Constructs a FileException for the given file with a custom message and error type.
 FileException (const File &file, ExceptionType type=e_generic)
 Constructs a FileException for the given file and error type.
const FilegetFile () const
 Returns the file associated with this exception.
ExceptionType getType () const
 Returns the type of file error that occurred.

Detailed Description

An Exception that contains information about a runtime error with a particular File.


This is typically thrown when an action with a file causes an error to occur within the NDEVR API

Definition at line 42 of file Exception.h.

Member Enumeration Documentation

◆ ExceptionType

Categorizes the type of file error that occurred.

Enumerator
e_generic 

A generic, unspecified file error.

e_no_open 

The file could not be opened.

e_already_open 

The file is already open by another process or handle.

e_does_not_exist 

The file does not exist at the specified path.

e_file_exits 

The file already exists when a new file was expected.

e_file_invalid 

The file is invalid or corrupted.

e_checksum_failed 

The file checksum verification failed.

e_not_supported 

The file format or operation is not supported.

e_no_create 

The file could not be created.

Definition at line 48 of file Exception.h.

Constructor & Destructor Documentation

◆ FileException() [1/2]

FileException::FileException ( const File & file,
ExceptionType type = e_generic )
explicit

Constructs a FileException for the given file and error type.

Parameters
[in]fileThe file that caused the exception.
[in]typeThe category of file error that occurred.

References e_generic.

◆ FileException() [2/2]

FileException::FileException ( const File & file,
const TranslatedString & message,
ExceptionType type = e_generic )

Constructs a FileException for the given file with a custom message and error type.

Parameters
[in]fileThe file that caused the exception.
[in]messageA translated description of the error.
[in]typeThe category of file error that occurred.

References e_generic.

Member Function Documentation

◆ getFile()

const File & FileException::getFile ( ) const
inline

Returns the file associated with this exception.

Returns
A const reference to the File that caused the error.

Definition at line 79 of file Exception.h.

◆ getType()

ExceptionType FileException::getType ( ) const
inline

Returns the type of file error that occurred.

Returns
The ExceptionType categorizing this error.

Definition at line 84 of file Exception.h.


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