3#include <system/type_info.h>
4#include <system/threading/cancellation_token.h>
5#include <system/span.h>
6#include <system/scope_guard.h>
7#include <system/object_ext.h>
8#include <system/nullable.h>
9#include <system/memory_extensions.h>
10#include <system/memory.h>
11#include <system/io/stream.h>
12#include <system/func.h>
13#include <system/exceptions.h>
14#include <system/details/stack_array.h>
15#include <system/details/patterns.h>
16#include <system/details/dispose_guard.h>
17#include <system/default.h>
18#include <system/collections/list.h>
19#include <system/collections/ienumerator.h>
20#include <system/buffers/array_pool.h>
21#include <system/array.h>
25#include "system/text/json/serialization/json_serializer_options.h"
26#include "system/text/json/throw_helper.h"
27#include "system/text/json/document/json_document.h"
28#include "system/text/json/document/json_element.h"
29#include "system/text/json/nodes/json_node.h"
30#include "system/text/json/reader/utf8_json_reader.h"
31#include "system/text/json/writer/utf8_json_writer.h"
32#include "system/text/json/json_encoded_text.h"
33#include "system/text/json/serialization/read_stack.h"
34#include "system/text/json/pooled_byte_buffer_writer.h"
35#include "system/text/json/writer/json_writer_options.h"
36#include "system/text/json/reader/json_reader_options.h"
37#include "system/text/json/json_comment_handling.h"
38#include "system/text/json/reader/json_reader_state.h"
39#include "system/text/json/json_exception.h"
40#include "system/text/json/json_constants.h"
41#include "system/text/json/reader/json_reader_helper.h"
42#include "system/text/json/serialization/stream_read_buffer_state.h"
43#include "system/text/json/writer/utf8_json_writer_cache.h"
44#include "system/text/json/document/json_document_options.h"
45#include "system/text/json/nodes/json_node_options.h"
54class JsonSerializerOptions;
60template <
typename>
class CastingConverter;
61class DefaultObjectConverter;
62template <
typename,
typename>
class ListOfTConverter;
63template <
typename>
class ObjectDefaultConverter;
64template <
typename>
class ObjectWithParameterizedConstructorConverter;
66template <
typename,
typename>
class JsonCollectionConverter;
67class JsonConverterBase;
68template <
typename>
class JsonConverter;
69template <
typename...>
class JsonDictionaryConverter;
71class JsonSerializerContext;
74class JsonPolymorphismOptions;
75class JsonPropertyInfoBase;
76class PolymorphicTypeResolver;
111 template<
typename TValue>
115 if (System::IsNull(document))
117 throw System::ArgumentNullException(u
"document");
119 if (System::IsNull(jsonTypeInfo))
121 throw System::ArgumentNullException(u
"jsonTypeInfo");
124 jsonTypeInfo->EnsureConfigured();
126 return ReadFromSpan<TValue>(utf8Json, jsonTypeInfo);
131 template<
typename TValue>
134 if (System::IsNull(jsonTypeInfo))
136 throw System::ArgumentNullException(u
"jsonTypeInfo");
139 jsonTypeInfo->EnsureConfigured();
141 return ReadFromSpan<TValue>(utf8Json, jsonTypeInfo);
146 template<
typename TValue>
149 if (System::IsNull(jsonTypeInfo))
151 throw System::ArgumentNullException(u
"jsonTypeInfo");
154 jsonTypeInfo->EnsureConfigured();
155 return ReadFromNode<TValue>(node, jsonTypeInfo);
160 template<
typename TValue>
163 if (System::IsNull(jsonTypeInfo))
165 throw System::ArgumentNullException(u
"jsonTypeInfo");
168 jsonTypeInfo->EnsureConfigured();
169 return Read<TValue>(
System::Ref(reader), jsonTypeInfo);
174 template<
typename TValue>
177 if (System::IsNull(System::ExplicitCast<System::Object>(json)))
179 throw System::ArgumentNullException(u
"json");
181 if (System::IsNull(jsonTypeInfo))
183 throw System::ArgumentNullException(u
"jsonTypeInfo");
186 jsonTypeInfo->EnsureConfigured();
187 return ReadFromSpan<TValue>(MemoryExtensions::AsSpan(json), jsonTypeInfo);
190 template<
typename TValue>
193 if (System::IsNull(jsonTypeInfo))
195 throw System::ArgumentNullException(u
"jsonTypeInfo");
198 jsonTypeInfo->EnsureConfigured();
199 return ReadFromSpan<TValue>(json, jsonTypeInfo);
202 template<
typename TValue>
205 if (System::IsNull(options))
207 throw System::ArgumentNullException(u
"options");
210 return Deserialize<TValue>(json, options->template GetTypeInfo<TValue>());
217 template<
typename TValue>
220 if (System::IsNull(utf8Json))
222 throw System::ArgumentNullException(u
"utf8Json");
224 if (System::IsNull(jsonTypeInfo))
226 throw System::ArgumentNullException(u
"jsonTypeInfo");
229 jsonTypeInfo->EnsureConfigured();
230 return jsonTypeInfo->Deserialize(utf8Json);
235 template<
typename TValue>
238 if (System::IsNull(jsonTypeInfo))
240 throw System::ArgumentNullException(u
"jsonTypeInfo");
243 jsonTypeInfo->EnsureConfigured();
244 return ReadFromSpan<TValue>(utf8Json, jsonTypeInfo);
249 template<
typename TValue>
252 if (System::IsNull(writer))
254 throw System::ArgumentNullException(u
"writer");
256 if (System::IsNull(jsonTypeInfo))
258 throw System::ArgumentNullException(u
"jsonTypeInfo");
261 jsonTypeInfo->EnsureConfigured();
262 jsonTypeInfo->Serialize(writer,
value);
267 template<
typename TValue>
270 if (System::IsNull(utf8Json))
272 throw System::ArgumentNullException(u
"utf8Json");
274 if (System::IsNull(jsonTypeInfo))
276 throw System::ArgumentNullException(u
"jsonTypeInfo");
279 jsonTypeInfo->EnsureConfigured();
280 jsonTypeInfo->Serialize(utf8Json,
value);
285 template<
typename TValue>
288 if (System::IsNull(jsonTypeInfo))
290 throw System::ArgumentNullException(u
"jsonTypeInfo");
293 jsonTypeInfo->EnsureConfigured();
294 return WriteString<TValue>(
value, jsonTypeInfo);
297 template<
typename TValue>
300 if (System::IsNull(options))
302 throw System::ArgumentNullException(u
"options");
305 return Serialize<TValue>(
value, options->template GetTypeInfo<TValue>());
310 template<
typename TValue>
313 if (System::IsNull(jsonTypeInfo))
315 throw System::ArgumentNullException(u
"jsonTypeInfo");
318 jsonTypeInfo->EnsureConfigured();
319 return WriteDocument<TValue>(
value, jsonTypeInfo);
324 template<
typename TValue>
327 if (System::IsNull(jsonTypeInfo))
329 throw System::ArgumentNullException(u
"jsonTypeInfo");
332 jsonTypeInfo->EnsureConfigured();
333 return WriteNode<TValue>(
value, jsonTypeInfo);
338 template<
typename TValue>
341 if (System::IsNull(jsonTypeInfo))
343 throw System::ArgumentNullException(u
"jsonTypeInfo");
346 jsonTypeInfo->EnsureConfigured();
347 return WriteElement<TValue>(
value, jsonTypeInfo);
352 template<
typename TValue>
355 if (System::IsNull(jsonTypeInfo))
357 throw System::ArgumentNullException(u
"jsonTypeInfo");
360 jsonTypeInfo->EnsureConfigured();
361 return WriteBytes<TValue>(
value, jsonTypeInfo);
382 return Serialization::Details::UnboxOnRead<T>(
value);
388 return Serialization::Details::UnboxOnWrite<T>(
value);
413 #if defined(__MSVC__)
414 #pragma warning( push )
415 #pragma warning(disable : 4715)
416 #pragma warning(disable : 4700)
417 #pragma warning(disable : 4701)
418 #elif defined(__GNUC__)
419 #pragma GCC diagnostic push
420 #pragma GCC diagnostic ignored "-Wreturn-type"
422 template<
typename TValue>
429 auto output = System::MakeObject<PooledByteBufferWriter>(options->get_DefaultBufferSize());
431 System::Details::DisposeGuard<1> __dispose_guard_0({output});
436 auto writer = System::MakeObject<Utf8JsonWriter>(output, options->GetWriterOptions());
438 System::Details::DisposeGuard<1> __dispose_guard_1({writer});
444 writer->WriteNullValue();
448 node->WriteTo(writer, options);
453 __dispose_guard_1.SetCurrentException(std::current_exception());
456 return ReadFromSpan<TValue>(output->get_WrittenSpan(), jsonTypeInfo);
460 __dispose_guard_0.SetCurrentException(std::current_exception());
465 #if defined(__MSVC__)
466 #pragma warning( pop )
467 #elif defined(__GNUC__)
468 #pragma GCC diagnostic pop
472 template<
typename TValue>
473 static TValue
Read(Utf8JsonReader& reader,
System::SharedPtr<Serialization::Metadata::JsonTypeInfo<TValue>> jsonTypeInfo)
481 ReadStack state = System::Default<System::Text::Json::ReadStack>();
482 state.Initialize(jsonTypeInfo);
483 Utf8JsonReader restore = reader;
490 catch (JsonException& )
498 static ASPOSECPP_SHARED_API Utf8JsonReader GetReaderScopedToNextValue(Utf8JsonReader& reader, ReadStack& state);
499 template<
typename TValue>
500 static TValue ReadFromSpan(ReadOnlySpan<char16_t> json,
System::SharedPtr<Serialization::Metadata::JsonTypeInfo<TValue>> jsonTypeInfo)
506 System::Details::StackArray<uint8_t, System::Text::Json::JsonConstants::StackallocByteThreshold> array_0;
510 auto __finally_guard_0 = ::System::MakeScopeGuard([&utf8, &tempArray]()
512 if (!(tempArray ==
nullptr))
515 Buffers::ArrayPool<uint8_t>::get_Shared()->Return(tempArray);
522 utf8 = utf8.Slice(0, actualByteCount);
523 return ReadFromSpan<TValue>(utf8, jsonTypeInfo, actualByteCount);
533 template<
typename TValue>
534 static TValue ReadFromSpan(ReadOnlySpan<uint8_t> utf8Json,
System::SharedPtr<Serialization::Metadata::JsonTypeInfo<TValue>> jsonTypeInfo, Nullable<int32_t> actualByteCount =
nullptr)
536 ASPOSE_UNUSED(actualByteCount);
538 JsonReaderState readerState(jsonTypeInfo->get_Options()->GetReaderOptions());
539 Utf8JsonReader reader(utf8Json,
true, readerState);
541 ReadStack state = System::Default<System::Text::Json::ReadStack>();
542 state.Initialize(jsonTypeInfo);
553 template<
typename TValue>
554 static String WriteString(
const TValue& value,
System::SharedPtr<Serialization::Metadata::JsonTypeInfo<TValue>> jsonTypeInfo)
561 auto __finally_guard_0 = ::System::MakeScopeGuard([&output, &writer]()
568 jsonTypeInfo->Serialize(writer, value);
579 template<
typename TValue>
591 auto __finally_guard_0 = ::System::MakeScopeGuard([&writer]()
598 jsonTypeInfo->Serialize(writer, value);
609 template<
typename TValue>
619 auto __finally_guard_0 = ::System::MakeScopeGuard([&output, &writer]()
626 jsonTypeInfo->Serialize(writer, value);
637 template<
typename TValue>
638 static JsonElement WriteElement(
const TValue& value,
System::SharedPtr<Serialization::Metadata::JsonTypeInfo<TValue>> jsonTypeInfo)
647 auto __finally_guard_0 = ::System::MakeScopeGuard([&output, &writer]()
654 jsonTypeInfo->Serialize(writer, value);
665 template<
typename TValue>
673 auto __finally_guard_0 = ::System::MakeScopeGuard([&output, &writer]()
680 jsonTypeInfo->Serialize(writer, value);
681 return output->get_WrittenSpan().ToArray();
692 static struct __StaticConstructor__ { __StaticConstructor__(); } s_constructor__;
ReadOnlySpan< T > get_Span() const
Gets a read-only span that represents the current memory.
Definition: memory.h:243
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 const int64_t ArrayPoolMaxSizeBeforeUsingNormalAlloc
Definition: json_constants.h:65
static const int32_t StackallocByteThreshold
Definition: json_constants.h:107
static const int32_t MaxExpansionFactorWhileTranscoding
Definition: json_constants.h:64
static System::SharedPtr< JsonDocument > ParseRented(System::SharedPtr< PooledByteBufferWriter > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
Definition: json_element.h:59
ReadOnlyMemory< uint8_t > GetRawValue()
static JsonElement Parse(ReadOnlySpan< uint8_t > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
Definition: json_encoded_text.h:29
static int32_t GetUtf8ByteCount(ReadOnlySpan< char16_t > text)
static String TranscodeHelper(ReadOnlySpan< uint8_t > utf8Unescaped)
static int32_t GetUtf8FromText(ReadOnlySpan< char16_t > text, Span< uint8_t > dest)
Definition: json_serializer_helpers.h:91
static T UnboxOnRead(System::SharedPtr< Object > value)
Definition: json_serializer_helpers.h:380
static void Serialize(System::SharedPtr< IO::Stream > utf8Json, System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Object > Deserialize(JsonElement element, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > LookupProperty(System::SharedPtr< Object > obj, ReadOnlySpan< uint8_t > unescapedPropertyName, ReadStack &state, System::SharedPtr< JsonSerializerOptions > options, bool &useExtensionProperty, bool createExtensionProperty=true)
static TValue Deserialize(String json, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:175
static String Serialize(TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:286
static const float FlushThreshold
Definition: json_serializer_helpers.h:367
static T UnboxOnWrite(System::SharedPtr< Object > value)
Definition: json_serializer_helpers.h:386
static System::SharedPtr< Object > Deserialize(ReadOnlySpan< uint8_t > utf8Json, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static const String ValuesPropertyName
Definition: json_serializer_helpers.h:374
static System::SharedPtr< Nodes::JsonNode > SerializeToNode(System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static System::SharedPtr< Object > Deserialize(System::SharedPtr< JsonDocument > document, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
friend class ThrowHelper
Definition: json_serializer_helpers.h:101
static System::SharedPtr< Object > Deserialize(ReadOnlySpan< char16_t > json, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static JsonElement SerializeToElement(System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static void Serialize(System::SharedPtr< IO::Stream > utf8Json, System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static TValue Deserialize(String json, System::SharedPtr< JsonSerializerOptions > options)
Definition: json_serializer_helpers.h:203
static ReadOnlySpan< uint8_t > GetPropertyName(ReadStack &state, Utf8JsonReader &reader, System::SharedPtr< JsonSerializerOptions > options, bool &isAlreadyReadMetadataProperty)
static TValue Deserialize(ReadOnlySpan< uint8_t > utf8Json, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:236
static MetadataPropertyName WriteMetadataForCollection(System::SharedPtr< Serialization::JsonConverterBase > jsonConverter, WriteStack &state, System::SharedPtr< Utf8JsonWriter > writer)
static System::SharedPtr< Object > Deserialize(String json, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static String Serialize(System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static System::SharedPtr< Nodes::JsonNode > SerializeToNode(TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:325
static System::SharedPtr< Object > Deserialize(JsonElement element, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static TValue Deserialize(ReadOnlySpan< char16_t > json, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:191
static MetadataPropertyName GetMetadataPropertyName(ReadOnlySpan< uint8_t > propertyName, System::SharedPtr< Serialization::Metadata::PolymorphicTypeResolver > resolver)
static System::SharedPtr< Object > Deserialize(ReadOnlySpan< uint8_t > utf8Json, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static void ValidateMetadataForObjectConverter(ReadStack &state)
static bool IsValidNumberHandlingValue(Serialization::JsonNumberHandling handling)
static System::SharedPtr< Object > Deserialize(System::SharedPtr< IO::Stream > utf8Json, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static TValue Deserialize(JsonElement element, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:132
static System::SharedPtr< Object > Deserialize(Utf8JsonReader &reader, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Object > Deserialize(Utf8JsonReader &reader, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static void Serialize(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static JsonEncodedText s_metadataType
Definition: json_serializer_helpers.h:375
static TValue Deserialize(Utf8JsonReader &reader, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:161
static void CreateExtensionDataProperty(System::SharedPtr< Object > obj, System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo, System::SharedPtr< JsonSerializerOptions > options)
static System::SharedPtr< Array< uint8_t > > SerializeToUtf8Bytes(System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static const String TypePropertyName
Definition: json_serializer_helpers.h:373
static System::SharedPtr< Object > Deserialize(System::SharedPtr< IO::Stream > utf8Json, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Nodes::JsonNode > SerializeToNode(System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Object > Deserialize(System::SharedPtr< Nodes::JsonNode > node, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static JsonEncodedText s_metadataValues
Definition: json_serializer_helpers.h:376
static const String SerializationUnreferencedCodeMessage
Definition: json_serializer_helpers.h:371
static MetadataPropertyName WriteMetadataForObject(System::SharedPtr< Serialization::JsonConverterBase > jsonConverter, WriteStack &state, System::SharedPtr< Utf8JsonWriter > writer)
static System::SharedPtr< JsonDocument > SerializeToDocument(TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:311
static void Serialize(System::SharedPtr< IO::Stream > utf8Json, TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:268
static void Serialize(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Object > Deserialize(System::SharedPtr< Nodes::JsonNode > node, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static System::SharedPtr< JsonDocument > SerializeToDocument(System::SharedPtr< Object > value, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo)
static JsonElement SerializeToElement(TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:339
friend class JsonSerializerOptions
Definition: json_serializer_helpers.h:94
static System::SharedPtr< Array< uint8_t > > SerializeToUtf8Bytes(TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:353
static bool IsMetadataPropertyName(ReadOnlySpan< uint8_t > propertyName, System::SharedPtr< Serialization::Metadata::PolymorphicTypeResolver > resolver)
static TValue Deserialize(System::SharedPtr< Nodes::JsonNode > node, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:147
static TValue Deserialize(System::SharedPtr< IO::Stream > utf8Json, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:218
static String Serialize(TValue value, System::SharedPtr< JsonSerializerOptions > options)
Definition: json_serializer_helpers.h:298
static String Serialize(System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static void Serialize(System::SharedPtr< Utf8JsonWriter > writer, TValue value, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:250
static System::SharedPtr< Array< uint8_t > > SerializeToUtf8Bytes(System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static TValue Deserialize(System::SharedPtr< JsonDocument > document, System::SharedPtr< Serialization::Metadata::JsonTypeInfo< TValue > > jsonTypeInfo)
Definition: json_serializer_helpers.h:112
static void ValidateMetadataForArrayConverter(System::SharedPtr< Serialization::JsonConverterBase > converter, Utf8JsonReader &reader, ReadStack &state)
static System::SharedPtr< Object > Deserialize(String json, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< Object > Deserialize(System::SharedPtr< JsonDocument > document, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< JsonDocument > SerializeToDocument(System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static const String SerializationRequiresDynamicCodeMessage
Definition: json_serializer_helpers.h:372
static bool TryReadMetadata(System::SharedPtr< Serialization::JsonConverterBase > converter, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > jsonTypeInfo, Utf8JsonReader &reader, ReadStack &state)
static System::SharedPtr< Object > Deserialize(ReadOnlySpan< char16_t > json, const TypeInfo &returnType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static JsonElement SerializeToElement(System::SharedPtr< Object > value, const TypeInfo &inputType, System::SharedPtr< Serialization::JsonSerializerContext > context)
static System::SharedPtr< JsonNode > Parse(Utf8JsonReader &reader, Nullable< JsonNodeOptions > nodeOptions=nullptr)
Definition: read_stack.h:35
Definition: casting_converter.h:48
Definition: object_converter.h:101
Definition: object_default_converter.h:64
Definition: object_with_parameterized_constructor_converter.h:64
Definition: json_collection_converter.h:43
Definition: json_converter.h:76
Definition: json_converter_of_t.h:80
Definition: json_converter.h:45
Definition: json_polymorphism_options.h:48
Definition: json_property_info.h:80
Definition: json_type_info.h:106
Definition: json_type_info_of_t.h:84
Definition: polymorphic_type_resolver.h:52
static void ThrowArgumentException_SerializerDoesNotSupportComments(String paramName)
Definition: utf8_json_reader.h:78
static System::SharedPtr< Utf8JsonWriter > RentWriterAndBuffer(System::SharedPtr< JsonSerializerOptions > options, System::SharedPtr< PooledByteBufferWriter > &bufferWriter)
static System::SharedPtr< Utf8JsonWriter > RentWriter(System::SharedPtr< JsonSerializerOptions > options, System::SharedPtr< Buffers::IBufferWriter< uint8_t > > bufferWriter)
static void ReturnWriter(System::SharedPtr< Utf8JsonWriter > writer)
static void ReturnWriterAndBuffer(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< PooledByteBufferWriter > bufferWriter)
Definition: write_stack.h:34
Represents a particular type and provides information about it.
Definition: type_info.h:109
@ Text
Defines color adjustment information for text.
@ Read
Stream is for reading only.
JsonNumberHandling
Definition: json_number_handling.h:16
MetadataPropertyName
Definition: metadata_property_name.h:13
Definition: db_command.h:9
decltype(Ref(std::declval< T & >())) Ref(const std::reference_wrapper< T > &wrapper)
Wrapper to make sure Ref(std::ref(DynamicWeakPtr)) works.
Definition: dynamic_weak_ptr.h:207