7#include "system/string.h"
8#include "system/exception.h"
9#include "system/nullable.h"
13#define E_FAIL__ 0x80004005
20#define EXCEPTION_NAMESPACE(pns, ns) namespace ns\
23 inline const System::String& CURRENT_NAMESPACE()\
25 static const System::String name = System::String(ASPOSE_T(#pns)).IsEmpty() ? System::String(ASPOSE_T(#ns)) : System::String(ASPOSE_T(#pns) "::" ASPOSE_T(#ns));\
34#define __ThisTypeInfo_Runtime_NameSpace(thisType) \
35 struct ThisTypeInfo : System::TypeInfoPtr { \
36 ThisTypeInfo() : System::TypeInfoPtr(thisType) {
40#define RTTI_INFO_NAMESPACE(thisType, baseTypes) \
41 __RTTI_INFO_METHODS(thisType, baseTypes) \
42 __ThisTypeInfo_Runtime_NameSpace((CURRENT_NAMESPACE() + u"::" + ASPOSE_T(#thisType))) \
48#define DECLARE_INHERITED_EXCEPTION(name, parent) \
49class Details_##name; \
50using name = System::ExceptionWrapper<Details_##name>; \
51class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
52 friend class System::ExceptionWrapperHelper; \
53 template <typename T> friend class System::ExceptionWrapper; \
54 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
57 using BaseType = parent; \
59 Details_##name() : parent() {} \
60 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
63 Details_##name(const System::String &message) : parent(message) {} \
64 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
68 Details_##name(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException) : parent(message, innerException) {} \
69 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
70 CODEPORTING_ARGS(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException), \
71 CODEPORTING_ARGS(message, innerException) \
76 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
77 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
78 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
79 CODEPORTING_ARGS(info, context) \
82 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
87#define DECLARE_INHERITED_EXCEPTION_MSG(name, parent) \
88class Details_##name; \
89using name = System::ExceptionWrapper<Details_##name>; \
90class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
91 friend class System::ExceptionWrapperHelper; \
92 template <typename T> friend class System::ExceptionWrapper; \
93 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
96 using BaseType = parent; \
98 Details_##name() : parent(MessageDefault()) {} \
99 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
102 Details_##name(const System::String &message) : parent(DefaultMessageIfNull(message)) {} \
103 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
107 Details_##name(const System::String &message, const System::Exception& innerException) : parent(DefaultMessageIfNull(message), innerException) {} \
108 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
109 CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), \
110 CODEPORTING_ARGS(message, innerException) \
115 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
116 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
117 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
118 CODEPORTING_ARGS(info, context) \
121 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
125 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
129 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
135#define DECLARE_INHERITED_EXCEPTION_MSG2(name, parent) \
136class Details_##name; \
137using name = System::ExceptionWrapper<Details_##name>; \
138class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
139 friend class System::ExceptionWrapperHelper; \
140 template <typename T> friend class System::ExceptionWrapper; \
141 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
144 using BaseType = parent; \
146 Details_##name() : parent(MessageDefault()) {} \
147 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
150 Details_##name(const System::String &message) : parent(DefaultMessageIfNull(message)) {} \
151 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
155 Details_##name(const System::String &message, const System::Exception& innerException) \
156 : parent(DefaultMessageIfNull(message), innerException) {} \
157 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
158 CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), \
159 CODEPORTING_ARGS(message, innerException) \
162 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
166 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
170 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
174#define DECLARE_INHERITED_EXCEPTION_WITH_EXTRA_CODE(name, parent, code) \
175class Details_##name; \
176using name = System::ExceptionWrapper<Details_##name>; \
177class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
178 friend class System::ExceptionWrapperHelper; \
179 template <typename T> friend class System::ExceptionWrapper; \
180 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
184 int get_##code() { return m_##code; } \
187 using BaseType = parent; \
189 Details_##name() : parent() {} \
190 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
193 Details_##name(int code) : parent(u""), m_##code(code) {} \
194 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(int code), CODEPORTING_ARGS(code)); \
197 Details_##name(const System::String &message) : parent(message) {} \
198 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
202 Details_##name(int code, const System::String &message) : parent(message), m_##code(code) {} \
203 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(int code, const System::String &message), CODEPORTING_ARGS(code, message)); \
207 Details_##name(const System::String &message, const System::Exception& innerException) : parent(message, innerException) {} \
208 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), CODEPORTING_ARGS(message, innerException)); \
212 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
213 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
214 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
215 CODEPORTING_ARGS(info, context) \
218 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
221 virtual String ExtraDescription() const override { return String::FromUtf8(std::to_string(m_##code)); } \
223 int m_##code = E_FAIL__; \
229#define DECLARE_INHERITED_EXCEPTION_MSG_AND_EXTRA_MEMBER(name, parent, member) \
230class Details_##name; \
231using name = System::ExceptionWrapper<Details_##name>; \
232class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
233 friend class System::ExceptionWrapperHelper; \
234 template <typename T> friend class System::ExceptionWrapper; \
235 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
239 String get_##member() { return m_##member; } \
242 using BaseType = parent; \
244 Details_##name() : parent(MessageDefault()) {} \
245 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
248 Details_##name(const System::String &message) : parent(DefaultMessageIfNull(message)) {} \
249 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
253 Details_##name(const System::String &message, const System::Exception& innerException) : parent(DefaultMessageIfNull(message), innerException) {} \
254 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
255 CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), \
256 CODEPORTING_ARGS(message, innerException) \
261 Details_##name(const System::String &message, const System::String & member) : parent(DefaultMessageIfNull(message)), m_##member(member) {} \
262 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message, const System::String & member), CODEPORTING_ARGS(message, member)); \
267 Details_##name(const System::String &message, const System::String & member, const System::Exception& innerException) \
268 : parent(DefaultMessageIfNull(message), innerException), m_##member(member) {} \
269 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
270 CODEPORTING_ARGS(const System::String &message, const System::String & member, const System::Exception& innerException), \
271 CODEPORTING_ARGS(message, member, innerException) \
276 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
277 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
278 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
279 CODEPORTING_ARGS(info, context) \
282 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
285 virtual String ExtraDescription() const override { return m_##member; } \
291 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
295 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
302#define DECLARE_INHERITED_EXCEPTION_MSG_AND_EXTRA_MEMBER2(name, parent, member) \
303class Details_##name; \
304using name = System::ExceptionWrapper<Details_##name>; \
305class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
306 friend class System::ExceptionWrapperHelper; \
307 template <typename T> friend class System::ExceptionWrapper; \
308 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
312 String get_##member() { return m_##member; } \
315 using BaseType = parent; \
317 Details_##name() : parent(MessageDefault()) {} \
318 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
321 Details_##name(const System::String &member) : parent(MessageDefault()), m_##member(member) {} \
322 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &member), CODEPORTING_ARGS(member)); \
326 Details_##name(const System::String &message, const System::Exception& innerException) : parent(DefaultMessageIfNull(message), innerException) {} \
327 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
328 CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), \
329 CODEPORTING_ARGS(message, innerException) \
334 Details_##name(const System::String &member, const System::String &message) : parent(DefaultMessageIfNull(message)), m_##member(member) {} \
335 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &member, const System::String &message), CODEPORTING_ARGS(member, message)); \
339 template<typename T> Details_##name(const System::String& member, const T&, const System::String& message) : parent(DefaultMessageIfNull(message)), m_##member(member) {} \
340 template<typename T> MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String& member, const T& t, const System::String& message), CODEPORTING_ARGS(member, t, message)); \
344 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
345 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
346 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
347 CODEPORTING_ARGS(info, context) \
350 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
353 virtual String ExtraDescription() const override { return m_##member; } \
359 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
363 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
370#define DECLARE_INHERITED_EXCEPTION_MSG_AND_EXTRA_NON_NULL_MEMBER(name, parent, member) \
371class Details_##name; \
372using name = System::ExceptionWrapper<Details_##name>; \
373class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
374 friend class System::ExceptionWrapperHelper; \
375 template <typename T> friend class System::ExceptionWrapper; \
376 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
380 String get_##member() { return m_##member; } \
383 using BaseType = parent; \
385 Details_##name() : parent(MessageDefault()), m_##member(System::String::Empty) {} \
386 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
389 Details_##name(const System::String &member) : parent(MessageDefault()), m_##member(EmptyStringIfNull(member)) {} \
390 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &member), CODEPORTING_ARGS(member)); \
394 Details_##name(const System::String &message, const System::Exception& innerException) \
395 : parent(DefaultMessageIfNull(message), innerException), m_##member(System::String::Empty) {} \
396 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
397 CODEPORTING_ARGS(const System::String &message, const System::Exception& innerException), \
398 CODEPORTING_ARGS(message, innerException) \
403 Details_##name(const System::String &member, const System::String &message) : parent(DefaultMessageIfNull(message)), m_##member(EmptyStringIfNull(member)) {} \
404 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
405 CODEPORTING_ARGS(const System::String &member, const System::String &message), \
406 CODEPORTING_ARGS(member, message) \
411 template<typename T> Details_##name(const System::String& member, const T&, const System::String& message) : parent(DefaultMessageIfNull(message)), m_##member(EmptyStringIfNull(member)) {} \
412 template<typename T> MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String& member, const T& t, const System::String& message), CODEPORTING_ARGS(member, t, message)); \
416 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
417 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
418 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
419 CODEPORTING_ARGS(info, context) \
422 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
425 virtual String ExtraDescription() const override { return m_##member; } \
431 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
435 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
439 ASPOSECPP_SHARED_API static const String& EmptyStringIfNull(const String& member); \
446#define DECLARE_INHERITED_EXCEPTION_MSG_AND_SUBSTITUTE_NON_NULL_MEMBER(name, parent, member) \
447class Details_##name; \
448using name = System::ExceptionWrapper<Details_##name>; \
449class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
450 friend class System::ExceptionWrapperHelper; \
451 template <typename T> friend class System::ExceptionWrapper; \
452 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
456 String get_##member() { return m_##member; } \
459 using BaseType = parent; \
463 Details_##name(const System::String &member, const System::Exception& innerException) \
464 : parent(DefaultMessage(member), innerException), m_##member(EmptyStringIfNull(member)) {} \
465 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
466 CODEPORTING_ARGS(const System::String &member, const System::Exception& innerException), \
467 CODEPORTING_ARGS(member, innerException) \
472 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
473 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, \
474 CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), \
475 CODEPORTING_ARGS(info, context) \
478 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
481 virtual String ExtraDescription() const override { return m_##member; } \
488 ASPOSECPP_SHARED_API static String DefaultMessage(const String& parameter); \
493 ASPOSECPP_SHARED_API static String DefaultMessageIfNull(const String& message, const String& parameter); \
497 ASPOSECPP_SHARED_API static const String& EmptyStringIfNull(const String& member); \
501#define DECLARE_EXTERNAL_EXCEPTION(name, parent, code) \
502class Details_##name; \
503using name = System::ExceptionWrapper<Details_##name>; \
504class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
505 friend class System::ExceptionWrapperHelper; \
506 template <typename T> friend class System::ExceptionWrapper; \
507 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
511 int get_##code() { return m_##code; } \
514 using BaseType = parent; \
516 Details_##name() : parent() {} \
517 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
520 Details_##name(const System::String &message) : parent(message) {} \
521 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
525 Details_##name(const System::String &message, int code) : parent(message), m_##code(code) {} \
526 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message, int code), CODEPORTING_ARGS(message, code)); \
530 Details_##name(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException) : parent(message, innerException) {} \
531 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException), CODEPORTING_ARGS(message, innerException)); \
535 Details_##name(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context) : parent(info, context) {} \
536 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::SharedPtr<System::Runtime::Serialization::SerializationInfo>& info, System::Runtime::Serialization::StreamingContext context), CODEPORTING_ARGS(info, context)); \
538 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
541 virtual String ExtraDescription() const override { return String::FromUtf8(std::to_string(m_##code)); } \
543 int m_##code = E_FAIL__; \
549#define DECLARE_INHERITED_EXCEPTION_MSG_AND_HRESULT(name, parent, hresult) \
550class Details_##name; \
551using name = System::ExceptionWrapper<Details_##name>; \
552class ASPOSECPP_SHARED_CLASS Details_##name : public parent { \
553 friend class System::ExceptionWrapperHelper; \
554 template <typename T> friend class System::ExceptionWrapper; \
555 RTTI_INFO_NAMESPACE(name, System::BaseTypesInfo<parent>) \
558 using BaseType = parent; \
560 Details_##name() : parent(MessageDefault()) {m_HResult = hresult;} \
561 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(), CODEPORTING_ARGS()); \
564 Details_##name(const System::String &message) : parent(DefaultMessageIfNull(message)) {m_HResult = hresult;} \
565 MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(const System::String &message), CODEPORTING_ARGS(message)); \
569 Details_##name(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException) \
570 : parent(DefaultMessageIfNull(message), innerException) {m_HResult = hresult;} \
571 MEMBER_FUNCTION_MAKE_OBJECT( Details_##name, \
572 CODEPORTING_ARGS(const System::String &message, const System::ExceptionWrapper<System::Details_Exception>& innerException), \
573 CODEPORTING_ARGS(message, innerException) \
576 [[noreturn]] void DoThrow(const System::ExceptionPtr& self) const override { throw System::ExceptionWrapper<Details_##name>(self); } \
580 ASPOSECPP_SHARED_API static const String& MessageDefault(); \
584 ASPOSECPP_SHARED_API static const String& DefaultMessageIfNull(const String& message); \
587EXCEPTION_NAMESPACE(,
System) {
752 EXCEPTION_NAMESPACE(
System, IO) {
756 DECLARE_INHERITED_EXCEPTION_MSG(EndOfStreamException, System::IO::Details_IOException);
760 DECLARE_INHERITED_EXCEPTION_MSG(DirectoryNotFoundException, System::IO::Details_IOException);
762 DECLARE_INHERITED_EXCEPTION_MSG_AND_EXTRA_MEMBER(FileLoadException, System::IO::Details_IOException, FileName);
764 DECLARE_INHERITED_EXCEPTION_MSG(PathTooLongException, System::IO::Details_IOException);
767 EXCEPTION_NAMESPACE(
System, Globalization) {
768 class Details_CultureNotFoundException;
775 friend class System::ExceptionWrapperHelper;
792 CODEPORTING_ARGS(message, innerException)
799 CODEPORTING_ARGS(message, invalidCultureId, innerException)
803 CODEPORTING_ARGS(
const String& paramName,
const String& invalidCultureName,
const String& message),
804 CODEPORTING_ARGS(paramName, invalidCultureName, message)
809 CODEPORTING_ARGS(message, invalidCultureName, innerException)
814 CODEPORTING_ARGS(info, context)
819 String m_invalid_culture_name;
822 ASPOSECPP_SHARED_API
static const String& MessageDefault();
826 ASPOSECPP_SHARED_API
static const String& DefaultMessageIfNull(
const String& message);
830 EXCEPTION_NAMESPACE(
System, Security) {
839 System::Security::Cryptography::Details_CryptographicException);
849 EXCEPTION_NAMESPACE(
System, Threading) {
862 EXCEPTION_NAMESPACE(
System, ComponentModel)
865 class Details_InvalidEnumArgumentException;
869 friend class System::ExceptionWrapperHelper;
884 CODEPORTING_ARGS(message, innerException)
890 CODEPORTING_ARGS(info, context)
897 CODEPORTING_ARGS(argumentName, invalidValue, enumClass));
903 ASPOSECPP_SHARED_API
static const String& MessageDefault();
907 ASPOSECPP_SHARED_API
static const String& DefaultMessageIfNull(
const String& message);
913 ASPOSECPP_SHARED_API
static const String DetailedMessage(
const String& argumentName,
int invalidValue,
const System::TypeInfo& enumClass);
917 EXCEPTION_NAMESPACE(
System, Collections)
926 EXCEPTION_NAMESPACE(
System, Web)
932 EXCEPTION_NAMESPACE(
System, Runtime)
944 EXCEPTION_NAMESPACE(
NUnit, Framework)
946 using System::SystemException;
956#define CODEPORTING_USER_EXCEPTION_BEGIN(ns, name, base) class Details_##name; \
957using name = System::ExceptionWrapper<Details_##name>; \
958class Details_##name : public base \
960 typedef Details_##name ThisType; \
961 typedef base BaseType; \
962 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo; \
963 RTTI_INFO_NAMED(Details_##name, #ns"::"#name, ThisTypeBaseTypesInfo); \
964 friend class ::System::ExceptionWrapperHelper; \
965 template <typename T> friend class ::System::ExceptionWrapper; \
967 [[noreturn]] void DoThrow(const ::System::ExceptionPtr& self) const override \
969 throw ::System::ExceptionWrapper<Details_##name>(self); \
973#define CODEPORTING_USER_EXCEPTION_END };
980#define CODEPORTING_USER_EXCEPTION_CONSTRUCTOR(name, args_with_types, args_without_types) protected: \
981MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(args_with_types), CODEPORTING_ARGS(args_without_types)); \
982Details_##name(args_with_types)
990#define CODEPORTING_DECLARE_USER_EXCEPTION_BEGIN(class_api, method_api, ns, name, base) class Details_##name; \
991using name = System::ExceptionWrapper<Details_##name>; \
992class class_api Details_##name : public base \
994 typedef Details_##name ThisType; \
995 typedef base BaseType; \
996 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo; \
997 RTTI_INFO_NAMED_DECLARE_EXPORTED(method_api, Details_##name, #ns"::"#name, ThisTypeBaseTypesInfo); \
998 friend class ::System::ExceptionWrapperHelper; \
999 template <typename T> friend class ::System::ExceptionWrapper; \
1001 [[noreturn]] method_api void DoThrow(const ::System::ExceptionPtr& self) const override;
1008#define CODEPORTING_EXPORTED_USER_EXCEPTION_CONSTRUCTOR(method_api, name, args_with_types, args_without_types) protected: \
1009MEMBER_FUNCTION_MAKE_OBJECT(Details_##name, CODEPORTING_ARGS(args_with_types), CODEPORTING_ARGS(args_without_types)); \
1010method_api Details_##name(args_with_types);
1012#define CODEPORTING_USER_EXCEPTION_IMPLEMENTATION(class_api, method_api, ns, name, base) \
1013const ::System::TypeInfo& ns::Details_##name::Type() { \
1014 return *System::static_holder<ThisTypeInfo>(); \
1016const System::TypeInfo& ns::Details_##name::GetType() const { \
1017 return Details_##name::Type(); \
1019bool ns::Details_##name::Is(const System::TypeInfo &target) const { \
1020 const System::TypeInfo& thisis = Details_##name::Type(); \
1021 return (thisis == target) ? true : ThisTypeBaseTypesInfo::CallIsForAll(this, target); \
1023[[noreturn]] void ns::Details_##name::DoThrow(const ::System::ExceptionPtr& self) const \
1025 throw ::System::ExceptionWrapper<Details_##name>(self); \
1027ns::Details_##name::ThisTypeInfo::ThisTypeInfo() \
1028 : System::TypeInfoPtr(ASPOSE_T(#ns) ASPOSE_T(#name), 0) \
Definition: exceptions.h:868
Details_InvalidEnumArgumentException(const String &message)
Definition: exceptions.h:878
Details_InvalidEnumArgumentException()
Definition: exceptions.h:875
void DoThrow(const System::ExceptionPtr &self) const override
Definition: exceptions.h:899
Details_InvalidEnumArgumentException(const String &message, const System::ExceptionWrapper< System::Details_Exception > &innerException)
Definition: exceptions.h:881
Details_InvalidEnumArgumentException(const String &argumentName, int invalidValue, const System::TypeInfo &enumClass)
Definition: exceptions.h:893
System::Details_ArgumentException BaseType
Definition: exceptions.h:873
Details_InvalidEnumArgumentException(const System::SharedPtr< System::Runtime::Serialization::SerializationInfo > &info, System::Runtime::Serialization::StreamingContext context)
Definition: exceptions.h:887
ArgumentException is thrown when an argument passed to a method being invoked is invalid....
ArithmeticException is throw when an error occurs during execution of arithmetic, conversion of casti...
Represents an exception. Never create instances of this class manually. Use the Exception class inste...
Definition: exception.h:277
The exception that is thrown when a method is invoked on an object which is in the state inconsistent...
MemberAccessException is thrown when access to non-existent class' member is attempted or when access...
NotSupportedException is thrown when a method being invoked is not supported or when an operation att...
A base class for classes that represent system (rather than application) exceptions....
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:113
CultureNotFoundException is thrown when an attempt is made to construct a culture that is not availab...
Definition: exceptions.h:774
void DoThrow(const System::ExceptionPtr &self) const override
Definition: exceptions.h:816
Details_CultureNotFoundException(const String &message, int invalidCultureId, const System::ExceptionWrapper< System::Details_Exception > &innerException)
Definition: exceptions.h:796
System::Details_ArgumentException BaseType
Definition: exceptions.h:782
Details_CultureNotFoundException(const String ¶mName, int invalidCultureId, const String &message)
Definition: exceptions.h:794
Details_CultureNotFoundException(const String &message)
Definition: exceptions.h:785
Details_CultureNotFoundException(const String &message, const String &invalidCultureName, const System::ExceptionWrapper< System::Details_Exception > &innerException)
Definition: exceptions.h:806
Details_CultureNotFoundException(const String ¶mName, const String &message)
Definition: exceptions.h:787
Details_CultureNotFoundException(const System::SharedPtr< System::Runtime::Serialization::SerializationInfo > &info, System::Runtime::Serialization::StreamingContext context)
Definition: exceptions.h:811
virtual Nullable< int > get_InvalidCultureId() const
Definition: exceptions.h:779
virtual String get_InvalidCultureName() const
Definition: exceptions.h:780
Details_CultureNotFoundException(const String ¶mName, const String &invalidCultureName, const String &message)
Definition: exceptions.h:801
Details_CultureNotFoundException()
Definition: exceptions.h:783
Details_CultureNotFoundException(const String &message, const System::ExceptionWrapper< System::Details_Exception > &innerException)
Definition: exceptions.h:789
Dummy class to make StreamingContext-using translated classes compile. Do not manage instances of thi...
Definition: streaming_context.h:12
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a particular type and provides information about it.
Definition: type_info.h:109
Definition: exceptions.h:942
Definition: algorithms.h:9
Definition: exception.h:18
Definition: ssl_enum_types.h:5
Definition: db_command.h:9
DECLARE_INHERITED_EXCEPTION_MSG(SystemException, System::Details_Exception)