CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
json_converter_factory.h
1#pragma once
2
3#include <cstdint>
4
5#include "system/text/json/serialization/json_converter.h"
6
7namespace System
8{
9namespace Text
10{
11namespace Json
12{
13enum class ConverterStrategy : uint8_t;
14class JsonSerializerOptions;
15class ReadStack;
16namespace Serialization
17{
18class JsonConverterBase;
19enum class JsonNumberHandling;
20} // namespace Serialization
21class Utf8JsonReader;
22class Utf8JsonWriter;
23class WriteStack;
24} // namespace Json
25} // namespace Text
26class TypeInfo;
27} // namespace System
28
29namespace System {
30
31namespace Text {
32
33namespace Json {
34
35namespace Serialization {
36
37class ASPOSECPP_SHARED_CLASS JsonConverterFactory : public JsonConverterBase
38{
41
42 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
43 ASPOSECPP_SHARED_RTTI_INFO_DECL();
44
46
47public:
48
49 ASPOSECPP_SHARED_API System::TypeInfo get_Type() override;
50
52
53protected:
54
55 ASPOSECPP_SHARED_API JsonConverterFactory();
56
58 ASPOSECPP_SHARED_API System::SharedPtr<Object> ReadAsObject(Utf8JsonReader& reader, const System::TypeInfo& typeToConvert, System::SharedPtr<JsonSerializerOptions> options) override;
59 ASPOSECPP_SHARED_API bool OnTryReadAsObject(Utf8JsonReader& reader, const System::TypeInfo& typeToConvert, System::SharedPtr<JsonSerializerOptions> options, ReadStack& state, System::SharedPtr<Object>& value) override;
60 ASPOSECPP_SHARED_API bool TryReadAsObject(Utf8JsonReader& reader, const System::TypeInfo& typeToConvert, System::SharedPtr<JsonSerializerOptions> options, ReadStack& state, System::SharedPtr<Object>& value) override;
68 ASPOSECPP_SHARED_API void WriteAsPropertyNameCoreAsObject(System::SharedPtr<Utf8JsonWriter> writer, System::SharedPtr<Object> value, System::SharedPtr<JsonSerializerOptions> options, bool isWritingExtensionDataProperty) override;
70
71private:
72
73 ASPOSECPP_SHARED_API System::Text::Json::ConverterStrategy GetDefaultConverterStrategy() override;
74
75};
76
77} // namespace Serialization
78} // namespace Json
79} // namespace Text
80} // namespace System
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: json_serializer_options.h:111
Definition: read_stack.h:35
Definition: json_converter_factory.h:38
System::SharedPtr< Object > ReadAsPropertyNameCoreAsObject(Utf8JsonReader &reader, const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options) override
bool TryWriteAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< JsonSerializerOptions > options, WriteStack &state) override
bool OnTryReadAsObject(Utf8JsonReader &reader, const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options, ReadStack &state, System::SharedPtr< Object > &value) override
void WriteNumberWithCustomHandlingAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, JsonNumberHandling handling) override
System::SharedPtr< Object > ReadNumberWithCustomHandlingAsObject(Utf8JsonReader &reader, JsonNumberHandling handling, System::SharedPtr< JsonSerializerOptions > options) override
bool TryReadAsObject(Utf8JsonReader &reader, const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options, ReadStack &state, System::SharedPtr< Object > &value) override
bool OnTryWriteAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< JsonSerializerOptions > options, WriteStack &state) override
void WriteAsPropertyNameCoreAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< JsonSerializerOptions > options, bool isWritingExtensionDataProperty) override
virtual System::SharedPtr< JsonConverterBase > CreateConverter(const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options)=0
void WriteAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< JsonSerializerOptions > options) override
System::SharedPtr< Object > ReadAsObject(Utf8JsonReader &reader, const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options) override
System::SharedPtr< Object > ReadAsPropertyNameAsObject(Utf8JsonReader &reader, const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options) override
System::SharedPtr< JsonConverterBase > GetConverterInternal(const System::TypeInfo &typeToConvert, System::SharedPtr< JsonSerializerOptions > options)
void WriteAsPropertyNameAsObject(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< Object > value, System::SharedPtr< JsonSerializerOptions > options) override
Definition: utf8_json_reader.h:78
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.
@ TypeInfo
Specifies that the member is a type.
JsonNumberHandling
Definition: json_number_handling.h:16
ConverterStrategy
Definition: converter_strategy.h:13
Definition: db_command.h:9