This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
System.Text.Json.cs
337 lines (336 loc) · 23.5 KB
/
System.Text.Json.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Text.Json
{
public enum JsonCommentHandling : byte
{
Allow = (byte)1,
Disallow = (byte)0,
Skip = (byte)2,
}
public sealed partial class JsonDocument : System.IDisposable
{
internal JsonDocument() { }
public System.Text.Json.JsonElement RootElement { get { throw null; } }
public void Dispose() { }
public static System.Text.Json.JsonDocument Parse(System.Buffers.ReadOnlySequence<byte> utf8Json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public static System.Text.Json.JsonDocument Parse(System.IO.Stream utf8Json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public static System.Text.Json.JsonDocument Parse(System.ReadOnlyMemory<byte> utf8Json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public static System.Text.Json.JsonDocument Parse(System.ReadOnlyMemory<char> json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public static System.Text.Json.JsonDocument Parse(string json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public static System.Threading.Tasks.Task<System.Text.Json.JsonDocument> ParseAsync(System.IO.Stream utf8Json, System.Text.Json.JsonReaderOptions readerOptions = default(System.Text.Json.JsonReaderOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Text.Json.JsonDocument ParseValue(ref System.Text.Json.Utf8JsonReader reader) { throw null; }
public static bool TryParseValue(ref System.Text.Json.Utf8JsonReader reader, out System.Text.Json.JsonDocument document) { throw null; }
}
public readonly partial struct JsonElement
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Text.Json.JsonElement this[int index] { get { throw null; } }
public System.Text.Json.JsonValueType Type { get { throw null; } }
public System.Text.Json.JsonElement.ArrayEnumerator EnumerateArray() { throw null; }
public System.Text.Json.JsonElement.ObjectEnumerator EnumerateObject() { throw null; }
public int GetArrayLength() { throw null; }
public bool GetBoolean() { throw null; }
public System.DateTime GetDateTime() { throw null; }
public System.DateTimeOffset GetDateTimeOffset() { throw null; }
public decimal GetDecimal() { throw null; }
public double GetDouble() { throw null; }
public System.Guid GetGuid() { throw null; }
public int GetInt32() { throw null; }
public long GetInt64() { throw null; }
public System.Text.Json.JsonElement GetProperty(System.ReadOnlySpan<byte> utf8PropertyName) { throw null; }
public System.Text.Json.JsonElement GetProperty(System.ReadOnlySpan<char> propertyName) { throw null; }
public System.Text.Json.JsonElement GetProperty(string propertyName) { throw null; }
public string GetRawText() { throw null; }
public float GetSingle() { throw null; }
public string GetString() { throw null; }
[System.CLSCompliantAttribute(false)]
public uint GetUInt32() { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong GetUInt64() { throw null; }
public override string ToString() { throw null; }
public bool TryGetDateTime(out System.DateTime value) { throw null; }
public bool TryGetDateTimeOffset(out System.DateTimeOffset value) { throw null; }
public bool TryGetDecimal(out decimal value) { throw null; }
public bool TryGetDouble(out double value) { throw null; }
public bool TryGetGuid(out System.Guid value) { throw null; }
public bool TryGetInt32(out int value) { throw null; }
public bool TryGetInt64(out long value) { throw null; }
public bool TryGetProperty(System.ReadOnlySpan<byte> utf8PropertyName, out System.Text.Json.JsonElement value) { throw null; }
public bool TryGetProperty(System.ReadOnlySpan<char> propertyName, out System.Text.Json.JsonElement value) { throw null; }
public bool TryGetProperty(string propertyName, out System.Text.Json.JsonElement value) { throw null; }
public bool TryGetSingle(out float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt32(out uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt64(out ulong value) { throw null; }
public void WriteAsProperty(ReadOnlySpan<byte> utf8PropertyName, ref Utf8JsonWriter writer) { }
public void WriteAsProperty(ReadOnlySpan<char> propertyName, ref Utf8JsonWriter writer) { }
public void WriteAsValue(ref System.Text.Json.Utf8JsonWriter writer) { }
public partial struct ArrayEnumerator : System.Collections.Generic.IEnumerable<System.Text.Json.JsonElement>, System.Collections.Generic.IEnumerator<System.Text.Json.JsonElement>, System.Collections.IEnumerable, System.Collections.IEnumerator, System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public System.Text.Json.JsonElement Current { get { throw null; } }
object System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { }
public System.Text.Json.JsonElement.ArrayEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
public void Reset() { }
System.Collections.Generic.IEnumerator<System.Text.Json.JsonElement> System.Collections.Generic.IEnumerable<System.Text.Json.JsonElement>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial struct ObjectEnumerator : System.Collections.Generic.IEnumerable<System.Text.Json.JsonProperty>, System.Collections.Generic.IEnumerator<System.Text.Json.JsonProperty>, System.Collections.IEnumerable, System.Collections.IEnumerator, System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public System.Text.Json.JsonProperty Current { get { throw null; } }
object System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { }
public System.Text.Json.JsonElement.ObjectEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
public void Reset() { }
System.Collections.Generic.IEnumerator<System.Text.Json.JsonProperty> System.Collections.Generic.IEnumerable<System.Text.Json.JsonProperty>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
}
public readonly partial struct JsonProperty
{
private readonly object _dummy;
public string Name { get { throw null; } }
public System.Text.Json.JsonElement Value { get { throw null; } }
public override string ToString() { throw null; }
}
public sealed partial class JsonReaderException : System.Exception
{
public JsonReaderException(string message, long lineNumber, long bytePositionInLine) { }
public long BytePositionInLine { get { throw null; } }
public long LineNumber { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial struct JsonReaderOptions
{
private int _dummyPrimitive;
public System.Text.Json.JsonCommentHandling CommentHandling { get { throw null; } set { } }
public int MaxDepth { get { throw null; } set { } }
public bool AllowTrailingCommas { get { throw null; } set { } }
}
public partial struct JsonReaderState
{
private object _dummy;
private int _dummyPrimitive;
public JsonReaderState(System.Text.Json.JsonReaderOptions options = default(System.Text.Json.JsonReaderOptions)) { throw null; }
public long BytesConsumed { get { throw null; } }
public System.Text.Json.JsonReaderOptions Options { get { throw null; } }
public System.SequencePosition Position { get { throw null; } }
}
public enum JsonTokenType : byte
{
Comment = (byte)11,
EndArray = (byte)4,
EndObject = (byte)2,
False = (byte)9,
None = (byte)0,
Null = (byte)10,
Number = (byte)7,
PropertyName = (byte)5,
StartArray = (byte)3,
StartObject = (byte)1,
String = (byte)6,
True = (byte)8,
}
public enum JsonValueType : byte
{
Array = (byte)2,
False = (byte)6,
Null = (byte)7,
Number = (byte)4,
Object = (byte)1,
String = (byte)3,
True = (byte)5,
Undefined = (byte)0,
}
public partial struct JsonWriterOptions
{
private int _dummyPrimitive;
public bool Indented { get { throw null; } set { } }
public bool SkipValidation { get { throw null; } set { } }
}
public partial struct JsonWriterState
{
private object _dummy;
private int _dummyPrimitive;
public JsonWriterState(System.Text.Json.JsonWriterOptions options = default(System.Text.Json.JsonWriterOptions)) { throw null; }
public long BytesCommitted { get { throw null; } }
public long BytesWritten { get { throw null; } }
public System.Text.Json.JsonWriterOptions Options { get { throw null; } }
}
public ref partial struct Utf8JsonReader
{
private object _dummy;
private int _dummyPrimitive;
public Utf8JsonReader(in System.Buffers.ReadOnlySequence<byte> jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; }
public Utf8JsonReader(System.ReadOnlySpan<byte> jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; }
public long BytesConsumed { get { throw null; } }
public int CurrentDepth { get { throw null; } }
public System.Text.Json.JsonReaderState CurrentState { get { throw null; } }
public bool HasValueSequence { get { throw null; } }
public System.SequencePosition Position { get { throw null; } }
public System.Text.Json.JsonTokenType TokenType { get { throw null; } }
public System.Buffers.ReadOnlySequence<byte> ValueSequence { get { throw null; } }
public System.ReadOnlySpan<byte> ValueSpan { get { throw null; } }
public bool GetBoolean() { throw null; }
public System.DateTime GetDateTime() { throw null; }
public System.DateTimeOffset GetDateTimeOffset() { throw null; }
public decimal GetDecimal() { throw null; }
public double GetDouble() { throw null; }
public System.Guid GetGuid() { throw null; }
public int GetInt32() { throw null; }
public long GetInt64() { throw null; }
public float GetSingle() { throw null; }
public string GetString() { throw null; }
[System.CLSCompliantAttribute(false)]
public uint GetUInt32() { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong GetUInt64() { throw null; }
public bool Read() { throw null; }
public bool TextEquals(System.ReadOnlySpan<byte> otherUtf8Text) { throw null; }
public bool TextEquals(System.ReadOnlySpan<char> otherText) { throw null; }
public bool TryGetDateTime(out System.DateTime value) { throw null; }
public bool TryGetDateTimeOffset(out System.DateTimeOffset value) { throw null; }
public bool TryGetDecimal(out decimal value) { throw null; }
public bool TryGetDouble(out double value) { throw null; }
public bool TryGetGuid(out System.Guid value) { throw null; }
public bool TryGetInt32(out int value) { throw null; }
public bool TryGetInt64(out long value) { throw null; }
public bool TryGetSingle(out float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt32(out uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt64(out ulong value) { throw null; }
}
public ref partial struct Utf8JsonWriter
{
private object _dummy;
private int _dummyPrimitive;
public Utf8JsonWriter(System.Buffers.IBufferWriter<byte> bufferWriter, System.Text.Json.JsonWriterState state = default(System.Text.Json.JsonWriterState)) { throw null; }
public long BytesCommitted { get { throw null; } }
public long BytesWritten { get { throw null; } }
public int CurrentDepth { get { throw null; } }
public void Flush(bool isFinalBlock = true) { }
public System.Text.Json.JsonWriterState GetCurrentState() { throw null; }
public void WriteBoolean(System.ReadOnlySpan<byte> utf8PropertyName, bool value, bool escape = true) { }
public void WriteBoolean(System.ReadOnlySpan<char> propertyName, bool value, bool escape = true) { }
public void WriteBoolean(string propertyName, bool value, bool escape = true) { }
public void WriteBooleanValue(bool value) { }
public void WriteCommentValue(System.ReadOnlySpan<byte> utf8Value, bool escape = true) { }
public void WriteCommentValue(System.ReadOnlySpan<char> value, bool escape = true) { }
public void WriteCommentValue(string value, bool escape = true) { }
public void WriteEndArray() { }
public void WriteEndObject() { }
public void WriteNull(System.ReadOnlySpan<byte> utf8PropertyName, bool escape = true) { }
public void WriteNull(System.ReadOnlySpan<char> propertyName, bool escape = true) { }
public void WriteNull(string propertyName, bool escape = true) { }
public void WriteNullValue() { }
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, decimal value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, double value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, int value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, long value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, float value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, uint value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(System.ReadOnlySpan<byte> utf8PropertyName, ulong value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<char> propertyName, decimal value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<char> propertyName, double value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<char> propertyName, int value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<char> propertyName, long value, bool escape = true) { }
public void WriteNumber(System.ReadOnlySpan<char> propertyName, float value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(System.ReadOnlySpan<char> propertyName, uint value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(System.ReadOnlySpan<char> propertyName, ulong value, bool escape = true) { }
public void WriteNumber(string propertyName, decimal value, bool escape = true) { }
public void WriteNumber(string propertyName, double value, bool escape = true) { }
public void WriteNumber(string propertyName, int value, bool escape = true) { }
public void WriteNumber(string propertyName, long value, bool escape = true) { }
public void WriteNumber(string propertyName, float value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(string propertyName, uint value, bool escape = true) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumber(string propertyName, ulong value, bool escape = true) { }
public void WriteNumberValue(decimal value) { }
public void WriteNumberValue(double value) { }
public void WriteNumberValue(int value) { }
public void WriteNumberValue(long value) { }
public void WriteNumberValue(float value) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumberValue(uint value) { }
[System.CLSCompliantAttribute(false)]
public void WriteNumberValue(ulong value) { }
public void WriteStartArray() { }
public void WriteStartArray(System.ReadOnlySpan<byte> utf8PropertyName, bool escape = true) { }
public void WriteStartArray(System.ReadOnlySpan<char> propertyName, bool escape = true) { }
public void WriteStartArray(string propertyName, bool escape = true) { }
public void WriteStartObject() { }
public void WriteStartObject(System.ReadOnlySpan<byte> utf8PropertyName, bool escape = true) { }
public void WriteStartObject(System.ReadOnlySpan<char> propertyName, bool escape = true) { }
public void WriteStartObject(string propertyName, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, System.DateTime value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, System.DateTimeOffset value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, System.Guid value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, System.ReadOnlySpan<byte> utf8Value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, System.ReadOnlySpan<char> value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<byte> utf8PropertyName, string value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, System.DateTime value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, System.DateTimeOffset value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, System.Guid value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, System.ReadOnlySpan<byte> utf8Value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, System.ReadOnlySpan<char> value, bool escape = true) { }
public void WriteString(System.ReadOnlySpan<char> propertyName, string value, bool escape = true) { }
public void WriteString(string propertyName, System.DateTime value, bool escape = true) { }
public void WriteString(string propertyName, System.DateTimeOffset value, bool escape = true) { }
public void WriteString(string propertyName, System.Guid value, bool escape = true) { }
public void WriteString(string propertyName, System.ReadOnlySpan<byte> utf8Value, bool escape = true) { }
public void WriteString(string propertyName, System.ReadOnlySpan<char> value, bool escape = true) { }
public void WriteString(string propertyName, string value, bool escape = true) { }
public void WriteStringValue(System.DateTime value) { }
public void WriteStringValue(System.DateTimeOffset value) { }
public void WriteStringValue(System.Guid value) { }
public void WriteStringValue(System.ReadOnlySpan<byte> utf8Value, bool escape = true) { }
public void WriteStringValue(System.ReadOnlySpan<char> value, bool escape = true) { }
public void WriteStringValue(string value, bool escape = true) { }
}
}
namespace System.Text.Json.Serialization
{
public static partial class JsonSerializer
{
public static object Parse(System.ReadOnlySpan<byte> utf8Json, System.Type returnType, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static object Parse(string json, System.Type returnType, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static TValue Parse<TValue>(System.ReadOnlySpan<byte> utf8Json, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static TValue Parse<TValue>(string json, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static System.Threading.Tasks.ValueTask<object> ReadAsync(System.IO.Stream utf8Json, System.Type returnType, System.Text.Json.Serialization.JsonSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.ValueTask<TValue> ReadAsync<TValue>(System.IO.Stream utf8Json, System.Text.Json.Serialization.JsonSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static byte[] ToBytes(object value, System.Type type, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static byte[] ToBytes<TValue>(TValue value, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static string ToString(object value, System.Type type, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static string ToString<TValue>(TValue value, System.Text.Json.Serialization.JsonSerializerOptions options = null) { throw null; }
public static System.Threading.Tasks.Task WriteAsync(object value, System.Type type, System.IO.Stream utf8Json, System.Text.Json.Serialization.JsonSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAsync<TValue>(TValue value, System.IO.Stream utf8Json, System.Text.Json.Serialization.JsonSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public sealed partial class JsonSerializerOptions
{
public JsonSerializerOptions() { }
public int DefaultBufferSize { get { throw null; } set { } }
public bool IgnoreNullPropertyValueOnRead { get { throw null; } set { } }
public bool IgnoreNullPropertyValueOnWrite { get { throw null; } set { } }
public System.Text.Json.JsonReaderOptions ReaderOptions { get { throw null; } set { } }
public System.Text.Json.JsonWriterOptions WriterOptions { get { throw null; } set { } }
}
}