7 instantiations of JsonValue
Microsoft.Analyzers.Local (7)
ApiLifecycle\Json\JsonValue.cs (7)
26
public static readonly JsonValue Null =
new
(JsonValueType.Null, default, null);
362
return new
JsonValue
(value);
371
return new
JsonValue
(value);
380
return new
JsonValue
(value);
389
return new
JsonValue
(value);
398
return new
JsonValue
(value);
413
: new
JsonValue
(value.Value.ToString("o", CultureInfo.InvariantCulture));
80 references to JsonValue
Microsoft.Analyzers.Local (78)
ApiLifecycle\Json\JsonArray.cs (11)
18
internal sealed class JsonArray : IEnumerable<
JsonValue
>
20
private readonly List<
JsonValue
> _items = [];
26
public JsonArray(params
JsonValue
[] values)
49
public
JsonValue
this[int index]
53
:
JsonValue
.Null;
62
public JsonArray Add(
JsonValue
value)
74
public JsonArray Insert(int index,
JsonValue
value)
106
public bool Contains(
JsonValue
item) => _items.Contains(item);
113
public int IndexOf(
JsonValue
item) => _items.IndexOf(item);
119
public IEnumerator<
JsonValue
> GetEnumerator() => _items.GetEnumerator();
137
public
JsonValue
[] Items { get; }
ApiLifecycle\Json\JsonObject.cs (16)
17
internal sealed class JsonObject : IEnumerable<KeyValuePair<string,
JsonValue
>>, IEnumerable<
JsonValue
>
19
private readonly IDictionary<string,
JsonValue
> _properties;
26
_properties = new Dictionary<string,
JsonValue
>();
42
public
JsonValue
this[string key]
44
get => _properties.TryGetValue(key, out
var
value)
46
:
JsonValue
.Null;
56
public JsonObject Add(string key) => Add(key,
JsonValue
.Null);
64
public JsonObject Add(string key,
JsonValue
value)
106
if (_properties.TryGetValue(oldKey, out
var
value))
127
public bool Contains(
JsonValue
value) => _properties.Values.Contains(value);
133
public IEnumerator<KeyValuePair<string,
JsonValue
>> GetEnumerator() => _properties.GetEnumerator();
139
IEnumerator<
JsonValue
> IEnumerable<
JsonValue
>.GetEnumerator() => _properties.Values.GetEnumerator();
185
private readonly
JsonValue
_value;
187
public KeyValuePair(string key,
JsonValue
value)
ApiLifecycle\Json\JsonReader.cs (12)
29
/// <returns>The parsed <see cref="
JsonValue
"/>.</returns>
30
public static
JsonValue
Parse(TextReader reader)
44
/// <returns>The parsed <see cref="
JsonValue
"/>.</returns>
45
public static
JsonValue
Parse(string source)
62
private
JsonValue
ReadJsonValue()
87
private
JsonValue
ReadNull()
90
return
JsonValue
.Null;
93
private
JsonValue
ReadBoolean()
121
private
JsonValue
ReadNumber()
295
var
value = ReadJsonValue();
350
var
value = ReadJsonValue();
384
private
JsonValue
Parse()
ApiLifecycle\Json\JsonValue.cs (38)
21
internal readonly struct JsonValue : IEquatable<
JsonValue
>
26
public static readonly
JsonValue
Null = new(JsonValueType.Null, default, null);
31
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct, representing a Boolean value.
48
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct, representing a Number value.
65
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct, representing a String value.
82
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct, representing a JsonObject.
99
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct, representing a Array reference value.
116
/// Initializes a new instance of the <see cref="
JsonValue
"/> struct.
295
public
JsonValue
this[string key]
327
/// Thrown when this <see cref="
JsonValue
"/> is not a <see cref="JsonArray"/>.
329
public
JsonValue
this[int index]
360
public static implicit operator
JsonValue
(bool? value)
369
public static implicit operator
JsonValue
(double? value)
378
public static implicit operator
JsonValue
(string value)
387
public static implicit operator
JsonValue
(JsonObject value)
396
public static implicit operator
JsonValue
(JsonArray value)
409
public static implicit operator
JsonValue
(DateTime? value)
420
public static explicit operator int(
JsonValue
jsonValue)
433
public static explicit operator int?(
JsonValue
jsonValue)
442
public static explicit operator bool(
JsonValue
jsonValue)
455
public static explicit operator bool?(
JsonValue
jsonValue)
464
public static explicit operator double(
JsonValue
jsonValue)
477
public static explicit operator double?(
JsonValue
jsonValue)
488
public static explicit operator string?(
JsonValue
jsonValue)
499
public static explicit operator JsonObject?(
JsonValue
jsonValue)
508
public static explicit operator JsonArray?(
JsonValue
jsonValue)
517
public static explicit operator DateTime(
JsonValue
jsonValue)
526
public static explicit operator DateTime?(
JsonValue
jsonValue)
538
public static bool operator ==(
JsonValue
a,
JsonValue
b)
550
public static bool operator !=(
JsonValue
a,
JsonValue
b)
559
/// <returns>The <see cref="
JsonValue
"/> representing the parsed text.</returns>
560
public static
JsonValue
Parse(string text)
565
public bool Equals(
JsonValue
other)
573
if (obj is
JsonValue
jv)
596
private readonly
JsonValue
_jsonValue;
599
public JsonValueDebugView(
JsonValue
jsonValue)
ApiLifecycle\ModelLoader.cs (1)
65
var
value = JsonReader.Parse(reader);
Microsoft.Analyzers.Local.Tests (2)
Json\JsonReaderTest.cs (1)
17
var
jsonObject = JsonValue.Parse("{ \"x\": \"value\", \"value\": \"value\" }");
Json\JsonScannerTest.cs (1)
51
var
obj = JsonValue.Parse("{ /* * / */ }");