Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Text.Json.Serialization.Converters.EnumConverter< T > Class Template Referencesealed

Public Member Functions

override bool CanConvert (Type type)
 
 EnumConverter (EnumConverterOptions converterOptions, JsonSerializerOptions serializerOptions)
 
 EnumConverter (EnumConverterOptions converterOptions, JsonNamingPolicy namingPolicy, JsonSerializerOptions serializerOptions)
 
override T Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 
override void Write (Utf8JsonWriter writer, T value, JsonSerializerOptions options)
 
virtual T ReadAsPropertyName (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 
virtual void WriteAsPropertyName (Utf8JsonWriter writer, T value, JsonSerializerOptions options)
 

Package Functions

override T ReadAsPropertyNameCore (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 
override void WriteAsPropertyNameCore (Utf8JsonWriter writer, T value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
 
virtual object CreateObject (JsonSerializerOptions options)
 
virtual void ReadElementAndSetProperty (object obj, string propertyName, ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state)
 
JsonPropertyInfo CreateJsonPropertyInfo ()
 
override JsonPropertyInfo CreateJsonPropertyInfo ()
 
JsonParameterInfo CreateJsonParameterInfo ()
 
override JsonParameterInfo CreateJsonParameterInfo ()
 
object ReadCoreAsObject (ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state)
 
override object ReadCoreAsObject (ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state)
 
bool ShouldFlush (Utf8JsonWriter writer, ref WriteStack state)
 
bool TryReadAsObject (ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object value)
 
override bool TryReadAsObject (ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object value)
 
bool TryWriteAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, ref WriteStack state)
 
override bool TryWriteAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, ref WriteStack state)
 
bool WriteCoreAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, ref WriteStack state)
 
override bool WriteCoreAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, ref WriteStack state)
 
void WriteAsPropertyNameCoreAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
 
override void WriteAsPropertyNameCoreAsObject (Utf8JsonWriter writer, object value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
 
virtual void Initialize (JsonSerializerOptions options, JsonTypeInfo jsonTypeInfo=null)
 
virtual void CreateInstanceForReferenceResolver (ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options)
 
T ReadCore (ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state)
 
bool WriteCore (Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
 
virtual bool OnTryWrite (Utf8JsonWriter writer, T value, JsonSerializerOptions options, ref WriteStack state)
 
virtual bool OnTryRead (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T value)
 
bool TryRead (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T value)
 
bool TryWrite (Utf8JsonWriter writer, in T value, JsonSerializerOptions options, ref WriteStack state)
 
bool TryWriteDataExtensionProperty (Utf8JsonWriter writer, T value, JsonSerializerOptions options, ref WriteStack state)
 
void VerifyRead (JsonTokenType tokenType, int depth, long bytesConsumed, bool isValueConverter, ref Utf8JsonReader reader)
 
void VerifyWrite (int originalDepth, Utf8JsonWriter writer)
 
virtual T ReadNumberWithCustomHandling (ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
 
virtual void WriteNumberWithCustomHandling (Utf8JsonWriter writer, T value, JsonNumberHandling handling)
 

Static Package Functions

static bool SingleValueReadWithReadAhead (ConverterStrategy converterStrategy, ref Utf8JsonReader reader, ref ReadStack state)
 
static bool DoSingleValueReadWithReadAhead (ref Utf8JsonReader reader, ref ReadStack state)
 

Package Attributes

bool IsInternalConverterForNumberType
 

Properties

ConverterStrategy ConverterStrategy [get]
 
override ConverterStrategy ConverterStrategy [get]
 
bool CanUseDirectReadOrWrite [get, set]
 
virtual bool CanHaveIdMetadata [get]
 
bool CanBePolymorphic [get, set]
 
TypeElementType [get]
 
override? Type ElementType [get]
 
TypeKeyType [get]
 
override? Type KeyType [get]
 
bool IsValueType [get, set]
 
bool IsInternalConverter [get, set]
 
virtual Type RuntimeType [get]
 
Type TypeToConvert [get]
 
override Type TypeToConvert [get]
 
virtual bool ConstructorIsParameterized [get]
 
ConstructorInfoConstructorInfo [get, set]
 
virtual bool RequiresDynamicMemberAccessors [get]
 
virtual bool HandleNull [get]
 
bool HandleNullOnRead [get, private set]
 
bool HandleNullOnWrite [get, private set]
 
bool CanBeNull [get]
 

Private Member Functions

JsonEncodedText FormatEnumValue (string value, JavaScriptEncoder encoder)
 
string FormatEnumValueToString (string value, JavaScriptEncoder encoder)
 

Static Private Member Functions

static ulong ConvertToUInt64 (object value)
 
static bool IsValidIdentifier (string value)
 
static bool IsNull (T value)
 

Private Attributes

readonly EnumConverterOptions _converterOptions
 
readonly JsonNamingPolicy _namingPolicy
 
readonly ConcurrentDictionary< ulong, JsonEncodedText_nameCache
 
ConcurrentDictionary< ulong, JsonEncodedText_dictionaryKeyPolicyCache
 

Static Private Attributes

static readonly TypeCode s_enumTypeCode = Type.GetTypeCode(typeof(T))
 
static readonly string s_negativeSign = (((int)s_enumTypeCode % 2 == 0) ? null : NumberFormatInfo.CurrentInfo.NegativeSign)
 

Detailed Description

Type Constraints
T :struct 
T :Enum 

Definition at line 8 of file EnumConverter.cs.


The documentation for this class was generated from the following file: