NDEVR
API Documentation
Exception.hpp
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 "DLLInfo.h"
34#include <NDEVR/BaseValues.h>
35#include <NDEVR/String.h>
36#include <NDEVR/TranslatedString.h>
37#include <exception>
38namespace NDEVR
39{
40
41 class UUID;
46 class Exception
47 {
48 public:
49 virtual ~Exception() = default;
50 NDEVR_BASE_API Exception(const String& title, const bool& capture_stack = true);
51 NDEVR_BASE_API Exception(const TranslatedString& title, const bool& capture_stack = true);
52 NDEVR_BASE_API Exception(const std::exception& exception);
53 NDEVR_BASE_API Exception(const TranslatedString& title, const TranslatedString& message, const bool& capture_stack = true);
54 void setTitle(const TranslatedString& title)
55 {
56 m_title = title;
57 }
58 virtual void setMessage(const TranslatedString& message)
59 {
60 m_message = message;
61 }
62 void setCategory(const TranslatedString& category)
63 {
64 m_category = category;
65 }
66 void setIcon(const String& icon)
67 {
68 m_icon = icon;
69 }
70 void setThread(const StringView& thread)
71 {
72 m_thread = thread;
73 }
74 void setPrority(const uint04 priority)
75 {
76 m_priority = priority;
77 }
78 virtual TranslatedString getMessage() const
79 {
80 return m_message;
81 }
82 virtual const TranslatedString& getTitle() const
83 {
84 return m_title;
85 }
86 virtual const TranslatedString& getCategory() const
87 {
88 return m_category;
89 }
90 virtual const String& stackTrace() const
91 {
92 return m_stack_trace;
93 }
94 virtual uint04 getPriority() const
95 {
96 return m_priority;
97 }
98
99 const String& thread() const
100 {
101 return m_thread;
102 }
103 NDEVR_BASE_API UUID id() const;
104 void printToLogger();
105 protected:
106 TranslatedString m_message;
107 TranslatedString m_title;
108 TranslatedString m_category;
109 String m_thread;
110 String m_stack_trace;
111 String m_icon;
112 uint04 m_priority;
113 };
114
115};
116
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ icon
Icon identifier for the object.
@ category
The category this object belongs to.