Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetPropertyName()

static ReadOnlySpan< byte > System.Text.Json.JsonSerializer.GetPropertyName ( ref ReadStack state,
ref Utf8JsonReader reader,
JsonSerializerOptions options )
inlinestaticpackage

Definition at line 718 of file JsonSerializer.cs.

719 {
720 ReadOnlySpan<byte> span = reader.GetSpan();
721 ReadOnlySpan<byte> result;
722 if (reader._stringHasEscaping)
723 {
724 int idx = span.IndexOf<byte>(92);
725 result = JsonReaderHelper.GetUnescapedSpan(span, idx);
726 }
727 else
728 {
729 result = span;
730 }
731 if (options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve && span.Length > 0 && span[0] == 36)
732 {
733 ThrowHelper.ThrowUnexpectedMetadataException(span, ref reader, ref state);
734 }
735 return result;
736 }

References System.Text.Json.Dictionary, System.Text.Json.JsonReaderHelper.GetUnescapedSpan(), System.options, System.state, and System.Text.Json.ThrowHelper.ThrowUnexpectedMetadataException().

Referenced by System.Text.Json.Serialization.Converters.ObjectDefaultConverter< T >.OnTryRead(), System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter< T >.ReadConstructorArguments(), System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter< T >.ReadConstructorArgumentsWithContinuation(), and System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter< T >.TryLookupConstructorParameter().