DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
Exception.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
System/Exception.h
"
3
#include "
System/SystemException.h
"
4
#include "
System/String.h
"
5
#include "
System/UnauthorizedAccessException.h
"
6
#include "
System/UnknownException.h
"
7
#include "
System/OutOfMemoryException.h
"
8
#include "
System/Security/SecurityException.h
"
9
#include "
System/IOException.h
"
10
11
#include <cstring>
12
13
namespace
DotNetDupe
{
14
namespace
System
{
15
Exception::Exception
() : std::runtime_error(
"Exception of type 'DotNetDupe::System::Exception' was thrown."
) {
17
}
18
19
Exception::Exception
(
const
String
& sMessage) : std::runtime_error(sMessage.GetRawString() ? sMessage.GetRawString() :
""
) {
21
}
22
23
Exception::Exception
(
const
String
& sMessage,
const
Exception
& innerException)
24
: std::runtime_error(sMessage.GetRawString() ? sMessage.GetRawString() :
""
), m_pInnerException(new
Exception
(innerException)) {
26
}
27
28
Exception::Exception
(
const
Exception
& other)
29
: std::runtime_error(other), m_pInnerException(other.m_pInnerException ? new
Exception
(*other.m_pInnerException) : nullptr) {
31
}
32
33
Exception
&
Exception::operator=
(
const
Exception
& other) {
35
if
(
this
!= &other) {
36
std::runtime_error::operator=(other);
37
delete
m_pInnerException;
38
m_pInnerException = other.m_pInnerException ?
new
Exception
(*other.m_pInnerException) :
nullptr
;
39
}
40
return
*
this
;
41
}
42
43
Exception::~Exception
() {
45
delete
m_pInnerException;
46
}
47
48
SystemException::SystemException
() :
Exception
() {}
49
SystemException::SystemException
(
const
String
& message) :
Exception
(message) {}
50
SystemException::SystemException
(
const
String
& message,
const
Exception
& innerException) :
Exception
(message, innerException) {}
51
52
UnauthorizedAccessException::UnauthorizedAccessException
() :
SystemException
(
"Attempted to perform an unauthorized operation."
) {}
53
UnknownException::UnknownException
() :
SystemException
(
"An unknown or unhandled non-DotNetDupe exception occurred."
) {}
54
OutOfMemoryException::OutOfMemoryException
() :
SystemException
(
"Insufficient memory to continue the execution of the program."
) {}
55
Security::SecurityException::SecurityException
() :
SystemException
(
"A security error has been detected."
) {}
56
IO::IOException::IOException
() :
SystemException
(
"I/O error occurred."
) {}
57
}
58
}
Exception.h
Represents errors that occur during application execution and serves as the ultimate base exception.
IOException.h
The exception that is thrown when an I/O error occurs.
OutOfMemoryException.h
The exception that is thrown when there is not enough memory to continue the execution of a program.
SecurityException.h
Exception thrown when a security error is detected.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
SystemException.h
Serves as the base class for system exceptions across the library.
UnauthorizedAccessException.h
The exception that is thrown when the operating system denies access because of an I/O error or a spe...
UnknownException.h
Represents an unknown or unmapped exception encountered during execution.
DotNetDupe::System::Exception::operator=
Exception & operator=(const Exception &other)
Copy assignment operator.
Definition
Exception.cpp:33
DotNetDupe::System::Exception::~Exception
virtual ~Exception()
Virtual destructor.
Definition
Exception.cpp:43
DotNetDupe::System::Exception::Exception
Exception()
Initializes a new instance of the Exception class with a default system-supplied message.
Definition
Exception.cpp:15
DotNetDupe::System::IO::IOException::IOException
IOException()
Initializes a new instance of the IOException class with a default message.
Definition
Exception.cpp:56
DotNetDupe::System::OutOfMemoryException::OutOfMemoryException
OutOfMemoryException()
Initializes a new instance of the OutOfMemoryException class with a default message.
Definition
Exception.cpp:54
DotNetDupe::System::Security::SecurityException::SecurityException
SecurityException()
Initializes a new instance of the SecurityException class with default properties.
Definition
Exception.cpp:55
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::SystemException::SystemException
SystemException()
Initializes a new instance of the SystemException class with a default message.
Definition
Exception.cpp:48
DotNetDupe::System::UnauthorizedAccessException::UnauthorizedAccessException
UnauthorizedAccessException()
Initializes a new instance of the UnauthorizedAccessException class with a default message.
Definition
Exception.cpp:52
DotNetDupe::System::UnknownException::UnknownException
UnknownException()
Initializes a new instance of the UnknownException class with a default message.
Definition
Exception.cpp:53
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
pch.h
DotNetDupe
Exception.cpp
Generated by
1.18.0