CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
throw_helper.h
1#pragma once
2
3#include <system/exceptions.h>
4
5#include <system/type_info.h>
6#include <system/text/decoder_fallback_exception.h>
7#include <system/text/encoder_fallback_exception.h>
8#include <system/span.h>
9#include <system/object_ext.h>
10#include <system/default.h>
11#include <system/collections/bitarray.h>
12#include <system/array.h>
13#include <cstdint>
14
15#include "system/text/json/writer/utf8_json_writer.h"
16#include "system/text/json/document/json_value_kind.h"
17#include "system/text/json/serialization/metadata/json_type_info_kind.h"
18#include "system/text/json/json_exception.h"
19#include "system/text/json/serialization/json_converter.h"
20
21namespace System
22{
25class String;
26
27} // namespace System
28
29namespace System {
30
32{
33 ch,
34 culture,
35 index,
36 input,
37 value
38};
39
40} // namespace System
41
42namespace System {
43
44namespace Text {
45
46namespace Json {
47
48namespace Serialization {
49 namespace Metadata {
50 class JsonPropertyInfoBase;
51 class JsonTypeInfoBase;
52 }
53}
54
55enum class NumericType
56{
57 Byte,
58 SByte,
59 Int16,
60 Int32,
61 Int64,
62 Int128,
63 UInt16,
64 UInt32,
65 UInt64,
66 UInt128,
67 Half,
68 Single,
69 Double,
70 Decimal,
75};
76
77enum class DataType
78{
79 Boolean,
86 Guid,
88};
89
91{
92 typedef ThrowHelper ThisType;
93
94public:
97 static ASPOSECPP_SHARED_API void ThrowArgumentNullException(ExceptionArgument argument);
98 static ASPOSECPP_SHARED_API void ThrowArgumentNullException(String parameterName);
99 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_NewLine(String parameterName);
100 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_IndentCharacter(String parameterName);
101 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_IndentSize(String parameterName, int32_t minimumSize, int32_t maximumSize);
102 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(String parameterName);
103 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_JsonNumberExponentTooLarge(String parameterName);
104 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(String parameterName);
105 static ASPOSECPP_SHARED_API void ThrowArgumentOutOfRangeException_NeedNonNegNum(String paramName);
106 static ASPOSECPP_SHARED_API void ThrowArgumentException_InvalidOffLen();
107 static ASPOSECPP_SHARED_API void ThrowArgumentException(String message);
108 static ASPOSECPP_SHARED_API void ThrowArgumentException_DestinationTooShort();
109 static ASPOSECPP_SHARED_API void ThrowArgumentException_PropertyNameTooLarge(int32_t tokenLength);
110 static ASPOSECPP_SHARED_API void ThrowArgumentException_ValueTooLarge(int64_t tokenLength);
111 static ASPOSECPP_SHARED_API void ThrowArgumentException_ValueNotSupported();
112 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NeedLargerSpan();
113 static ASPOSECPP_SHARED_API void ThrowPropertyNameTooLargeArgumentException(int32_t length);
114 static ASPOSECPP_SHARED_API void ThrowArgumentException(ReadOnlySpan<uint8_t> propertyName, ReadOnlySpan<uint8_t> value);
115 static ASPOSECPP_SHARED_API void ThrowArgumentException(ReadOnlySpan<uint8_t> propertyName, ReadOnlySpan<char16_t> value);
116 static ASPOSECPP_SHARED_API void ThrowArgumentException(ReadOnlySpan<char16_t> propertyName, ReadOnlySpan<uint8_t> value);
117 static ASPOSECPP_SHARED_API void ThrowArgumentException(ReadOnlySpan<char16_t> propertyName, ReadOnlySpan<char16_t> value);
118 static ASPOSECPP_SHARED_API void ThrowInvalidOperationOrArgumentException(ReadOnlySpan<uint8_t> propertyName, int32_t currentDepth, int32_t maxDepth);
119 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException(int32_t currentDepth, int32_t maxDepth);
120 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException(String message);
121 static ASPOSECPP_SHARED_API void ThrowInvalidOperationOrArgumentException(ReadOnlySpan<char16_t> propertyName, int32_t currentDepth, int32_t maxDepth);
122 static ASPOSECPP_SHARED_API InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType);
123 static ASPOSECPP_SHARED_API InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType);
124 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType);
125 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType);
126 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType);
127 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedPropertyName(JsonTokenType tokenType);
129 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType);
130 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_CannotSkipOnPartial();
132 static ASPOSECPP_SHARED_API void ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType);
133 static ASPOSECPP_SHARED_API InvalidOperationException GetJsonElementWrongTypeException(JsonValueKind expectedType, JsonValueKind actualType);
134 static ASPOSECPP_SHARED_API InvalidOperationException GetJsonElementWrongTypeException(String expectedTypeName, JsonValueKind actualType);
135 static ASPOSECPP_SHARED_API void ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, uint8_t nextByte = System::Default<uint8_t>(), ReadOnlySpan<uint8_t> bytes = System::Default<System::ReadOnlySpan<uint8_t>>());
136 static ASPOSECPP_SHARED_API JsonException GetJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, uint8_t nextByte, ReadOnlySpan<uint8_t> bytes);
137 static ASPOSECPP_SHARED_API String GetPrintableString(uint8_t value);
138 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType);
139 static ASPOSECPP_SHARED_API void ThrowArgumentException_InvalidUTF8(ReadOnlySpan<uint8_t> value);
140 static ASPOSECPP_SHARED_API void ThrowArgumentException_InvalidUTF16(int32_t charAsInt);
141 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ReadInvalidUTF16(int32_t charAsInt);
142 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ReadIncompleteUTF16();
143 static ASPOSECPP_SHARED_API InvalidOperationException GetInvalidOperationException_ReadInvalidUTF8(DecoderFallbackException innerException = nullptr);
144 static ASPOSECPP_SHARED_API InvalidOperationException GetInvalidOperationException(String message, Exception innerException);
145 static ASPOSECPP_SHARED_API InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType);
146 static ASPOSECPP_SHARED_API void ThrowOutOfMemoryException(uint32_t capacity);
147 static ASPOSECPP_SHARED_API void ThrowFormatException();
148 static ASPOSECPP_SHARED_API void ThrowFormatException(NumericType numericType);
149 static ASPOSECPP_SHARED_API void ThrowFormatException(DataType dataType);
150 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType);
151 static ASPOSECPP_SHARED_API void ThrowObjectDisposedException_Utf8JsonWriter();
152 static ASPOSECPP_SHARED_API void ThrowObjectDisposedException_JsonDocument();
153 static ASPOSECPP_SHARED_API void ThrowArgumentException_NodeValueNotAllowed(String paramName);
154 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeAlreadyHasParent();
155 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeCycleDetected();
157 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeWrongType(const System::SharedPtr<Array<String>>& supportedTypeNames);
158 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeParentWrongType(String typeName);
159 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeUnableToConvert(const TypeInfo& sourceType, const TypeInfo& destinationType);
160 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, const TypeInfo& destinationType);
161 static ASPOSECPP_SHARED_API void ThrowArgumentException_DeserializeWrongType(const TypeInfo& type, System::SharedPtr<Object> value);
162 static ASPOSECPP_SHARED_API void ThrowArgumentException_SerializerDoesNotSupportComments(String paramName);
163 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_SerializationNotSupported(const TypeInfo& propertyType);
165 static ASPOSECPP_SHARED_API void ThrowJsonException_DeserializeUnableToConvertValue(const TypeInfo& propertyType);
166 static ASPOSECPP_SHARED_API void ThrowInvalidCastException_DeserializeUnableToAssignValue(const TypeInfo& typeOfValue, const TypeInfo& declaredType);
167 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_DeserializeUnableToAssignNull(const TypeInfo& declaredType);
170 static ASPOSECPP_SHARED_API void ThrowJsonException_SerializerCycleDetected(int32_t maxDepth);
171 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_SerializerCycleDetected(int32_t maxDepth);
172 static ASPOSECPP_SHARED_API void ThrowJsonException(String message = nullptr);
173 static ASPOSECPP_SHARED_API void ThrowArgumentException_CannotSerializeInvalidType(String paramName, const TypeInfo& typeToConvert, const TypeInfo& declaringType, String propertyName);
174 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_CannotSerializeInvalidType(const TypeInfo& typeToConvert, const TypeInfo& declaringType, System::SharedPtr<Reflection::MemberInfo> memberInfo);
175 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ResolverTypeNotCompatible(const TypeInfo& requestedType, const TypeInfo& actualType);
180 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_TypeInfoImmutable();
182 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_SerializerPropertyNameConflict(const TypeInfo& type, String propertyName);
187 static ASPOSECPP_SHARED_API void ThrowJsonException_JsonRequiredPropertyMissing(const TypeInfo& type, String propertyList);
188 static ASPOSECPP_SHARED_API bool AppendMissingProperty(System::SharedPtr<StringBuilder> builder, String propertyName);
190 static ASPOSECPP_SHARED_API void ThrowJsonException_DuplicatePropertyNotAllowed();
191 static ASPOSECPP_SHARED_API void ThrowJsonException_DuplicatePropertyNotAllowed(String name);
194 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(const TypeInfo& converterType);
196 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters(const TypeInfo& parentType, String parameterName, String firstMatchName, String secondMatchName);
197 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(const TypeInfo& parentType);
199 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_JsonIncludeOnInaccessibleProperty(String memberName, const TypeInfo& declaringType);
200 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(String clrPropertyName, const TypeInfo& propertyDeclaringType);
205 static ASPOSECPP_SHARED_API void ReThrowWithPath(ReadStack& state, JsonReaderException ex);
206 static ASPOSECPP_SHARED_API void ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex);
207 static ASPOSECPP_SHARED_API void AddJsonExceptionInformation(ReadStack& state, Utf8JsonReader& reader, JsonException ex);
208 static ASPOSECPP_SHARED_API void ReThrowWithPath(WriteStack& state, Exception ex);
209 static ASPOSECPP_SHARED_API void AddJsonExceptionInformation(WriteStack& state, JsonException ex);
210 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(const TypeInfo& classType, const TypeInfo& attribute);
211 template<typename TAttribute>
213 {
214 throw InvalidOperationException(System::String::Format(u"The type '{0}' cannot have more than one member that has the attribute '{1}'.", System::ExplicitCast<System::Object>(classType), System::ExplicitCast<System::Object>(System::ObjectExt::GetType<TAttribute>())));
215 }
219 static ASPOSECPP_SHARED_API void ThrowNotSupportedException(ReadStack& state, Utf8JsonReader& reader, Exception innerException);
220 static ASPOSECPP_SHARED_API void ThrowNotSupportedException(WriteStack& state, Exception innerException);
222 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_CannotPopulateCollection(const TypeInfo& type, Utf8JsonReader& reader, ReadStack& state);
223 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType);
224 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType);
225 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind);
226 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataUnexpectedProperty(ReadOnlySpan<uint8_t> propertyName, ReadStack& state);
227 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataStandaloneValuesProperty(ReadStack& state, ReadOnlySpan<uint8_t> propertyName);
229 static ASPOSECPP_SHARED_API void ThrowJsonException_DuplicateMetadataProperty(ReadOnlySpan<uint8_t> utf8PropertyName);
230 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ReadStack& state, const TypeInfo& propertyType, Utf8JsonReader& reader);
231 static ASPOSECPP_SHARED_API void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ReadStack& state, const TypeInfo& propertyType);
233 static ASPOSECPP_SHARED_API void ThrowUnexpectedMetadataException(ReadOnlySpan<uint8_t> propertyName, Utf8JsonReader& reader, ReadStack& state);
235 static ASPOSECPP_SHARED_API NotSupportedException GetNotSupportedException_AmbiguousMetadataForType(const TypeInfo& type, const TypeInfo& match1, const TypeInfo& match2);
239 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_BaseConverterDoesNotSupportMetadata(const TypeInfo& derivedType);
240 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(const TypeInfo& derivedType);
241 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_RuntimeTypeNotSupported(const TypeInfo& baseType, const TypeInfo& runtimeType);
242 static ASPOSECPP_SHARED_API void ThrowNotSupportedException_RuntimeTypeDiamondAmbiguity(const TypeInfo& baseType, const TypeInfo& runtimeType, const TypeInfo& derivedType1, const TypeInfo& derivedType2);
243 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_TypeDoesNotSupportPolymorphism(const TypeInfo& baseType);
244 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_DerivedTypeNotSupported(const TypeInfo& baseType, const TypeInfo& derivedType);
245 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_DerivedTypeIsAlreadySpecified(const TypeInfo& baseType, const TypeInfo& derivedType);
246 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_TypeDicriminatorIdIsAlreadySpecified(const TypeInfo& baseType, System::SharedPtr<Object> typeDiscriminator);
248 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(const TypeInfo& type, String propertyName);
250 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_TypeClassifierNotSupported(const TypeInfo& classifierType, const TypeInfo& type);
251 static ASPOSECPP_SHARED_API void ThrowInvalidOperationException_UnsupportedEnumIdentifier(const TypeInfo& enumType, String enumName);
252 static ASPOSECPP_SHARED_API void ThrowJsonException_UnrecognizedTypeDiscriminator(System::SharedPtr<Object> typeDiscriminator);
254
255private:
256
257 static ArgumentOutOfRangeException GetArgumentOutOfRangeException(String parameterName, String message);
258 static ArgumentException GetArgumentException(String message);
259 static InvalidOperationException GetInvalidOperationException(String message);
260 static InvalidOperationException GetInvalidOperationException(int32_t currentDepth);
261 static InvalidOperationException GetInvalidOperationException(String message, JsonTokenType tokenType);
262 static InvalidOperationException GetInvalidOperationException(JsonTokenType tokenType);
263 static bool IsPrintable(uint8_t value);
264 static String GetResourceString(Utf8JsonReader& json, ExceptionResource resource, uint8_t nextByte, String characters);
265 static String GetResourceString(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType);
266 static String Truncate(ReadOnlySpan<char16_t> str);
267
268public:
269 ThrowHelper() = delete;
270};
271
273{
318};
319
320} // namespace Json
321} // namespace Text
322} // namespace System
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:296
Class that keeps static members of System.Boolean .Net type.
Definition: boolean.h:44
Contains methods to work with the unsigned 8-bit integer.
Definition: byte.h:57
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Contains the date and time of day relative to Coordinated Universal Time. Objects of this class shoul...
Definition: date_time_offset.h:16
Represents a decimal number. This type should be allocated on stack and passed to functions by value ...
Definition: decimal.h:107
ArgumentException is thrown when an argument passed to a method being invoked is invalid....
ArgumentOutOfRangeException is thrown when a method being invoked is passed an argument that falls ou...
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:118
Represents a Globally Unique IDentifier This type should be allocated on stack and passed to function...
Definition: guid.h:34
Contains methods to work with the 16-bit integer.
Definition: int16.h:18
Contains methods to work with the 32-bit integer.
Definition: int32.h:21
Contains methods to work with the 64-bit integer.
Definition: int64.h:18
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:126
static String Format(const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args)
Formats string in C# style.
Definition: string.h:1449
Definition: read_stack.h:35
Definition: throw_helper.h:91
static void ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(String parameterName)
static void ThrowJsonException_DuplicatePropertyNotAllowed()
static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan< uint8_t > propertyName, ReadStack &state, Utf8JsonReader &reader)
static InvalidOperationException GetInvalidOperationException_ReadInvalidUTF8(DecoderFallbackException innerException=nullptr)
static void ThrowInvalidOperationException_UnsupportedEnumIdentifier(const TypeInfo &enumType, String enumName)
static void ThrowNotSupportedException_SerializationNotSupported(const TypeInfo &propertyType)
static void ThrowArgumentOutOfRangeException_IndentCharacter(String parameterName)
static InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType)
static InvalidOperationException GetInvalidOperationException(String message, Exception innerException)
static void ThrowArgumentException_NodeValueNotAllowed(String paramName)
static bool AppendMissingProperty(System::SharedPtr< StringBuilder > builder, String propertyName)
static void ReThrowWithPath(WriteStack &state, Exception ex)
static void ThrowInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType)
static void ThrowArgumentException_DeserializeWrongType(const TypeInfo &type, System::SharedPtr< Object > value)
static void ThrowJsonException_DuplicatePropertyNotAllowed(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > property)
static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(const TypeInfo &declaredType)
static void ThrowInvalidOperationException(String message)
static void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, const TypeInfo &destinationType)
static void ThrowFormatException(DataType dataType)
static void ThrowInvalidOperationException_CreateObjectConverterNotCompatible(const TypeInfo &type)
static void ThrowInvalidOperationException_NodeElementCannotBeObjectOrArray()
static void ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
static void ThrowArgumentException_CannotSerializeInvalidType(String paramName, const TypeInfo &typeToConvert, const TypeInfo &declaringType, String propertyName)
static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowObjectDisposedException_JsonDocument()
static void ThrowPropertyNameTooLargeArgumentException(int32_t length)
static void ThrowInvalidCastException_DeserializeUnableToAssignValue(const TypeInfo &typeOfValue, const TypeInfo &declaredType)
static void ThrowJsonException_DeserializeUnableToConvertValue(const TypeInfo &propertyType)
static void ThrowInvalidOperationException_DerivedTypeIsAlreadySpecified(const TypeInfo &baseType, const TypeInfo &derivedType)
static void ThrowNotSupportedException_DeserializeNoConstructor(System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > typeInfo, Utf8JsonReader &reader, ReadStack &state)
static void ThrowInvalidOperationException_JsonPropertyRequiredAndExtensionData(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static InvalidOperationException GetJsonElementWrongTypeException(String expectedTypeName, JsonValueKind actualType)
static void ThrowInvalidOperationException_PolymorphicTypeConfigurationDoesNotSpecifyDerivedTypes(const TypeInfo &baseType)
static void ThrowInvalidOperationException_SerializerPropertyNameNull(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static Exception GetInvalidOperationException_NoMetadataForTypeProperties(System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver, const TypeInfo &type)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactory(const TypeInfo &converterType)
static NotSupportedException GetNotSupportedException_AmbiguousMetadataForType(const TypeInfo &type, const TypeInfo &match1, const TypeInfo &match2)
static void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType)
static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(String propertyName, System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType)
static void ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(const TypeInfo &type, String propertyName)
static const String ExceptionSourceValueToRethrowAsJsonException
Definition: throw_helper.h:95
static void ThrowArgumentException_InvalidUTF16(int32_t charAsInt)
static void ThrowInvalidOperationException_ResolverTypeInfoOptionsNotCompatible()
static void ThrowArgumentOutOfRangeException_NeedNonNegNum(String paramName)
static String GetPrintableString(uint8_t value)
static void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType)
static void ThrowNotSupportedException(ReadStack &state, Utf8JsonReader &reader, Exception innerException)
static void ThrowNotSupportedException_RuntimeTypeNotSupported(const TypeInfo &baseType, const TypeInfo &runtimeType)
static void ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(const TypeInfo &derivedType)
static void ThrowInvalidOperationException_NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty()
static void ThrowInvalidOperationException_CannotSkipOnPartial()
static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(String clrPropertyName, const TypeInfo &propertyDeclaringType)
static JsonException GetJsonReaderException(Utf8JsonReader &json, ExceptionResource resource, uint8_t nextByte, ReadOnlySpan< uint8_t > bytes)
static void ThrowArgumentException_SerializerDoesNotSupportComments(String paramName)
static void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters(const TypeInfo &parentType, String parameterName, String firstMatchName, String secondMatchName)
static void ThrowInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType)
static void ThrowOutOfMemoryException(uint32_t capacity)
static void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType)
static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType)
static void ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(String parameterName)
static void ThrowInvalidOperationException_JsonIncludeOnInaccessibleProperty(String memberName, const TypeInfo &declaringType)
static void ThrowInvalidOperationException_SerializerPropertyNameConflict(const TypeInfo &type, String propertyName)
static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
static void ThrowArgumentException(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< char16_t > value)
static void ThrowInvalidOperationException_NoMetadataForType(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver)
static void ThrowInvalidOperationException_NodeUnableToConvert(const TypeInfo &sourceType, const TypeInfo &destinationType)
static void ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Serialization::Metadata::JsonTypeInfoKind kind)
static void ReThrowWithPath(ReadStack &state, JsonReaderException ex)
static void ThrowNotSupportedException_RuntimeTypeDiamondAmbiguity(const TypeInfo &baseType, const TypeInfo &runtimeType, const TypeInfo &derivedType1, const TypeInfo &derivedType2)
static void ThrowArgumentOutOfRangeException_NewLine(String parameterName)
static void ThrowInvalidOperationException_NoMetadataForTypeProperties(System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver, const TypeInfo &type)
static void ThrowJsonException_MetadataStandaloneValuesProperty(ReadStack &state, ReadOnlySpan< uint8_t > propertyName)
static void ThrowInvalidOperationException_CannotMixEncodings(Utf8JsonWriter::EnclosingContainerType previousEncoding, Utf8JsonWriter::EnclosingContainerType currentEncoding)
static void AddJsonExceptionInformation(ReadStack &state, Utf8JsonReader &reader, JsonException ex)
static InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType)
static void ThrowJsonException_DuplicatePropertyNotAllowed(ReadOnlySpan< uint8_t > nameBytes)
static void ReThrowWithPath(ReadStack &state, Utf8JsonReader &reader, Exception ex)
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(const TypeInfo &classType)
Definition: throw_helper.h:212
static void ThrowInvalidOperationException_DerivedTypeNotSupported(const TypeInfo &baseType, const TypeInfo &derivedType)
static void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType)
static void ThrowInvalidOperationException_TypeClassifierNotSupported(const TypeInfo &classifierType, const TypeInfo &type)
static void ThrowJsonException_JsonRequiredPropertyMissing(const TypeInfo &type, String propertyList)
static void ThrowInvalidOperationException_ExpectedPropertyName(JsonTokenType tokenType)
static void ThrowArgumentOutOfRangeException_IndentSize(String parameterName, int32_t minimumSize, int32_t maximumSize)
static void ThrowArgumentException_JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo(String parameterName)
static void ThrowNotSupportedException_BaseConverterDoesNotSupportMetadata(const TypeInfo &derivedType)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< uint8_t > propertyName, int32_t currentDepth, int32_t maxDepth)
static void ThrowInvalidOperationException_InvalidCustomTypeDiscriminatorPropertyName()
static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ReadStack &state, const TypeInfo &propertyType)
static void ThrowInvalidOperationException_ReadIncompleteUTF16()
static void ThrowJsonException_SerializationConverterWrite(System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowInvalidOperationException_JsonPropertyInfoIsBoundToDifferentJsonTypeInfo(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > propertyInfo)
static void ThrowInvalidOperationException_NodeAlreadyHasParent()
static void ThrowNotSupportedException(WriteStack &state, Exception innerException)
static void ThrowJsonException_UnrecognizedTypeDiscriminator(System::SharedPtr< Object > typeDiscriminator)
static void ThrowArgumentException_ValueNotSupported()
static void ThrowInvalidOperationException_PropertyTypeNotNullable(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowArgumentNullException(String parameterName)
static void ThrowInvalidOperationException_ResolverTypeNotCompatible(const TypeInfo &requestedType, const TypeInfo &actualType)
static void ThrowInvalidOperationException_CannotSerializeInvalidType(const TypeInfo &typeToConvert, const TypeInfo &declaringType, System::SharedPtr< Reflection::MemberInfo > memberInfo)
static void ThrowArgumentException(String message)
static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowArgumentException_InvalidUTF8(ReadOnlySpan< uint8_t > value)
static void ThrowJsonException_MetadataUnexpectedProperty(ReadOnlySpan< uint8_t > propertyName, ReadStack &state)
static void ThrowArgumentException(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< uint8_t > value)
static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(const TypeInfo &keyType, System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowArgumentException(ReadOnlySpan< uint8_t > propertyName, ReadOnlySpan< uint8_t > value)
static void ThrowJsonReaderException(Utf8JsonReader &json, ExceptionResource resource, uint8_t nextByte=System::Default< uint8_t >(), ReadOnlySpan< uint8_t > bytes=System::Default< System::ReadOnlySpan< uint8_t > >())
static void AddJsonExceptionInformation(WriteStack &state, JsonException ex)
static void ThrowInvalidOperationException_NodeParentWrongType(String typeName)
static void ThrowArgumentException_DestinationTooShort()
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(const TypeInfo &classType, const TypeInfo &attribute)
static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind)
static void ThrowInvalidOperationException_TypeInfoResolverChainImmutable()
static void ThrowNotSupportedException_NoMetadataForType(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver)
static void ThrowJsonException_SerializationConverterRead(System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowArgumentException_ValueTooLarge(int64_t tokenLength)
static void ThrowInvalidOperationException(int32_t currentDepth, int32_t maxDepth)
static void ThrowInvalidOperationException_TypeDicriminatorIdIsAlreadySpecified(const TypeInfo &baseType, System::SharedPtr< Object > typeDiscriminator)
static void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(const TypeInfo &parentType)
static void ThrowNotSupportedException_CannotPopulateCollection(const TypeInfo &type, Utf8JsonReader &reader, ReadStack &state)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< char16_t > propertyName, int32_t currentDepth, int32_t maxDepth)
static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ReadStack &state, const TypeInfo &propertyType, Utf8JsonReader &reader)
static void ThrowArgumentException_InvalidOffLen()
static void ThrowObjectDisposedException_Utf8JsonWriter()
static void ThrowJsonException_JsonRequiredPropertyMissing(System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > parent, System::SharedPtr< Collections::BitArray > assignedOrNotRequiredPropertiesSet)
static void ThrowJsonException_DuplicateMetadataProperty(ReadOnlySpan< uint8_t > utf8PropertyName)
static void ThrowInvalidOperationException_JsonTypeInfoOnDeserializingCallbacksNotSupported(const TypeInfo &type)
static InvalidOperationException GetJsonElementWrongTypeException(JsonValueKind expectedType, JsonValueKind actualType)
static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType)
static void ThrowUnexpectedMetadataException(ReadOnlySpan< uint8_t > propertyName, Utf8JsonReader &reader, ReadStack &state)
static void ThrowArgumentOutOfRangeException_JsonNumberExponentTooLarge(String parameterName)
static void ThrowInvalidOperationException_ReadInvalidUTF16(int32_t charAsInt)
static void ThrowInvalidOperationException_TypeDoesNotSupportPolymorphism(const TypeInfo &baseType)
static void ThrowFormatException(NumericType numericType)
static void ThrowArgumentException_PropertyNameTooLarge(int32_t tokenLength)
static void ThrowInvalidOperationException_JsonSerializerOptionsNoTypeInfoResolverSpecified()
static void ThrowJsonException(String message=nullptr)
static void ThrowJsonException_SerializerCycleDetected(int32_t maxDepth)
static void ThrowArgumentNullException(ExceptionArgument argument)
static void ThrowInvalidOperationException_NodeWrongType(const System::SharedPtr< Array< String > > &supportedTypeNames)
static ArgumentException GetArgumentException_ReadInvalidUTF16(EncoderFallbackException innerException)
static void ThrowInvalidOperationException_InvalidChainedResolver()
static void ThrowInvalidOperationException_TypeInfoImmutable()
static void ThrowInvalidOperationException_SerializerCycleDetected(int32_t maxDepth)
static void ThrowInvalidOperationException_NodeCycleDetected()
static void ThrowInvalidOperationException_SerializerOptionsReadOnly(System::SharedPtr< Serialization::JsonSerializerContext > context)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(const TypeInfo &converterType)
static void ThrowArgumentException(ReadOnlySpan< uint8_t > propertyName, ReadOnlySpan< char16_t > value)
static void ThrowInvalidOperationException_NamingPolicyReturnNull(System::SharedPtr< JsonNamingPolicy > namingPolicy)
static void ThrowInvalidOperationException_NeedLargerSpan()
static void ThrowJsonException_DuplicatePropertyNotAllowed(String name)
static void ThrowInvalidOperationException_JsonPropertyRequiredAndNotDeserializable(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
Definition: utf8_json_reader.h:78
EnclosingContainerType
Definition: utf8_json_writer.h:114
Definition: write_stack.h:34
Represents a time interval. This type should be allocated on stack and passed to functions by value o...
Definition: timespan.h:59
Represents a particular type and provides information about it.
Definition: type_info.h:109
Represents a version number. This type should be allocated on stack and passed to functions by value ...
Definition: version.h:16
@ Text
Defines color adjustment information for text.
JsonTypeInfoKind
Definition: json_type_info_kind.h:14
JsonTokenType
Definition: json_token_type.h:12
ExceptionResource
Definition: throw_helper.h:273
DataType
Definition: throw_helper.h:78
JsonValueKind
Definition: json_value_kind.h:12
NumericType
Definition: throw_helper.h:56
Definition: db_command.h:9
ExceptionArgument
Definition: throw_helper.h:32
std::enable_if< IsExceptionWrapper< T >::value, constT & >::type Default()
Returns the reference to the single default-constructed instance of the exception type.
Definition: default.h:16
Contains methods to work with the double-precision floating-point number.
Definition: double.h:18
Contains methods to work with the 8-bit integer.
Definition: sbyte.h:18
Contains methods to work with the single-precision floating-point number.
Definition: single.h:18
Contains methods to work with the unsigned 16-bit integer.
Definition: uint16.h:18
Contains methods to work with the unsigned 32-bit integer.
Definition: uint32.h:18
Contains methods to work with the unsigned 64-bit integer.
Definition: uint64.h:18