Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
JsonProperty.cs
Go to the documentation of this file.
2
3namespace System.Text.Json;
4
5[DebuggerDisplay("{DebuggerDisplay,nq}")]
6public readonly struct JsonProperty
7{
8 public JsonElement Value { get; }
9
10 private string? _name { get; }
11
12 public string Name => _name ?? Value.GetPropertyName();
13
14 private string DebuggerDisplay
15 {
16 get
17 {
18 if (Value.ValueKind != 0)
19 {
20 return "\"" + ToString() + "\"";
21 }
22 return "<Undefined>";
23 }
24 }
25
26 internal JsonProperty(JsonElement value, string name = null)
27 {
28 Value = value;
29 _name = name;
30 }
31
32 public bool NameEquals(string? text)
33 {
34 return NameEquals(text.AsSpan());
35 }
36
41
43 {
45 }
46
51
53 {
54 if (writer == null)
55 {
56 throw new ArgumentNullException("writer");
57 }
58 writer.WritePropertyName(Name);
60 }
61
62 public override string ToString()
63 {
65 }
66}
void WriteTo(Utf8JsonWriter writer)
bool TextEqualsHelper(ReadOnlySpan< byte > utf8Text, bool isPropertyName, bool shouldUnescape)
bool NameEquals(ReadOnlySpan< char > text)
bool NameEquals(ReadOnlySpan< byte > utf8Text)
bool NameEquals(string? text)
void WriteTo(Utf8JsonWriter writer)
bool EscapedNameEquals(ReadOnlySpan< byte > utf8Text)
JsonProperty(JsonElement value, string name=null)