API Documentation
Loading...
Searching...
No Matches
Exception.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: Exception
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/File.h>
34#include "Exception.hpp"
35
36namespace NDEVR
37{
38 /**--------------------------------------------------------------------------------------------------
39 \brief An Exception that contains information about a runtime error with a particular File.
40 This is typically thrown when an action with a file causes an error to occur within the NDEVR API
41 **/
42 class FileException : public Exception
43 {
44 public:
57
58 public:
61 const File& getFile() const { return m_file; }
62 ExceptionType getType() const { return m_type; }
63 private:
64 void createDescription(const TranslatedString& message);
65 File m_file;
66 const ExceptionType m_type;
67 };
68 /**--------------------------------------------------------------------------------------------------
69 \brief An Exception thrown when the user cancels an operation.
70 This is not a true error but designed to be used in control paths that allow users to cancel activities.
71 **/
73 {
74 public:
76 };
77}
78
79
#define NDEVR_BASE_API
Definition DLLInfo.h:57
An Exception thrown when the user cancels an operation. This is not a true error but designed to be u...
Definition Exception.h:73
CancelException(const TranslatedString &message)
Provides consistent interface to handle errors through the throw expression. All exceptions generated...
Definition Exception.hpp:47
An Exception that contains information about a runtime error with a particular File....
Definition Exception.h:43
ExceptionType
Definition Exception.h:46
@ e_file_exits
Definition Exception.h:51
@ e_file_invalid
Definition Exception.h:52
@ e_no_create
Definition Exception.h:55
@ e_does_not_exist
Definition Exception.h:50
@ e_not_supported
Definition Exception.h:54
@ e_no_open
Definition Exception.h:48
@ e_generic
Definition Exception.h:47
@ e_already_open
Definition Exception.h:49
@ e_checksum_failed
Definition Exception.h:53
ExceptionType getType() const
Definition Exception.h:62
FileException(const File &file, const TranslatedString &message, ExceptionType type=e_generic)
FileException(const File &file, ExceptionType type=e_generic)
const File & getFile() const
Definition Exception.h:61
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37