3#include <system/type_info.h>
4#include <system/object_ext.h>
5#include <system/func.h>
6#include <system/details/pointer_collection_helpers.h>
7#include <system/details/patterns.h>
8#include <system/constraints.h>
9#include <system/collections/ienumerator_ng.h>
10#include <system/collections/idictionary.h>
11#include <system/collections/dictionary.h>
15#include "system/text/json/serialization/converters/collection/json_dictionary_converter.h"
16#include "system/text/json/writer/utf8_json_writer.h"
17#include "system/text/json/serialization/json_serializer_options.h"
18#include "system/text/json/serialization/write_stack.h"
19#include "system/text/json/serialization/write_stack_frame.h"
20#include "system/text/json/serialization/json_converter.h"
21#include "system/text/json/serialization/stack_frame_property_state.h"
22#include "system/text/json/serialization/read_stack.h"
23#include "system/text/json/serialization/read_stack_frame.h"
24#include "system/text/json/throw_helper.h"
25#include "system/text/json/reader/utf8_json_reader.h"
37template<
typename TDictionary>
45 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
46 RTTI_INFO_TEMPLATE_CLASS(
ThisType, ThisTypeBaseTypesInfo);
62 enumerator =
value->GetEnumerator();
64 if (!enumerator->MoveNext())
71 enumerator = System::ExplicitCast<System::Collections::Generic::IEnumerator<System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<System::Object>>>>(state.
Current.
CollectionEnumerator);
90 if (System::Is<String>(key, keyString))
110 }
while (enumerator->MoveNext());
117 ASPOSE_UNUSED(options);
124 return System::MakeObject<Collections::Generic::Dictionary<String, System::SharedPtr<Object>>>();
134 BaseType::SetTemplateWeakPtr(0);
144 TDictionary collection = System::ExplicitCast<TDictionary>(state.
Current.
ReturnValue);
146 collection->idx_set(System::ExplicitCast<System::Object>(key),
value);
148 if (this->get_IsValueType())
157 TDictionary returnValue = System::ExplicitCast<TDictionary>(state.
Current.
ReturnValue);
158 if (returnValue->get_IsReadOnly())
Forward declaration of Dictionary class.
Definition: dictionary.h:96
Interface for dictionary-alike containers. Objects of this class should only be allocated using Syste...
Definition: idictionary.h:21
Function delegate. This type should be allocated on stack and passed to functions by value or by refe...
Definition: func.h:82
static auto CoalesceAssign(T0 &value, T1 func) -> T0 &
Implementation of '??=' operator translation.
Definition: object_ext.h:748
static std::enable_if< std::is_fundamental< T >::value &&!std::is_enum< T >::value, constSystem::TypeInfo & >::type GetType()
Implements typeof() translation. Overload for primitive types.
Definition: object_type.h:94
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
System::SharedPtr< Object > ReturnValue
Definition: read_stack_frame.h:59
Definition: read_stack.h:35
ReadStackFrame Current
Definition: read_stack.h:44
Definition: i_dictionary_converter.h:39
bool OnWriteResume(System::SharedPtr< Utf8JsonWriter > writer, TDictionary value, System::SharedPtr< JsonSerializerOptions > options, WriteStack &state) override
Definition: i_dictionary_converter.h:57
void ConfigureJsonTypeInfo(System::SharedPtr< Metadata::JsonTypeInfoBase > jsonTypeInfo, System::SharedPtr< JsonSerializerOptions > options) override
Definition: i_dictionary_converter.h:115
void SetTemplateWeakPtr(uint32_t argument) override
Definition: i_dictionary_converter.h:129
void CreateCollection(Utf8JsonReader &reader, ReadStack &state) override
Definition: i_dictionary_converter.h:154
bool get_CanPopulate() override
Definition: i_dictionary_converter.h:52
void Add(String key, const System::SharedPtr< Object > &value, System::SharedPtr< JsonSerializerOptions > options, ReadStack &state) override
Definition: i_dictionary_converter.h:142
Definition: json_converter_of_t.h:80
Definition: json_converter.h:45
static void ThrowNotSupportedException_CannotPopulateCollection(const TypeInfo &type, Utf8JsonReader &reader, ReadStack &state)
Definition: utf8_json_reader.h:78
System::SharedPtr< Object > CollectionEnumerator
Definition: write_stack_frame.h:53
void EndDictionaryEntry()
bool IsWritingExtensionDataProperty
Definition: write_stack_frame.h:55
System::SharedPtr< System::Text::Json::Serialization::Metadata::JsonTypeInfoBase > JsonTypeInfo
Definition: write_stack_frame.h:56
StackFramePropertyState PropertyState
Definition: write_stack_frame.h:60
Definition: write_stack.h:34
WriteStackFrame Current
Definition: write_stack.h:45
@ Text
Defines color adjustment information for text.
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