49 references to JsonHelpers
System.Text.Json (49)
parent\Common\ReflectionExtensions.cs (1)
343
return
JsonHelpers
.TraverseGraphWithTopologicalSort(type, static t => t.GetInterfaces());
System\Text\Json\Document\JsonElement.cs (1)
1280
return
JsonHelpers
.AreEqualJsonNumbers(element1.GetRawValue().Span, element2.GetRawValue().Span);
System\Text\Json\JsonEncodedText.cs (1)
130
return new JsonEncodedText(
JsonHelpers
.EscapeValue(utf8Value, idx, encoder));
System\Text\Json\Reader\JsonReaderHelper.cs (8)
146
if (!
JsonHelpers
.IsValidDateTimeOffsetParseLength(segment.Length))
160
if (
JsonHelpers
.TryParseAsISO(segment, out DateTime tmp))
181
if (
JsonHelpers
.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length)
182
&&
JsonHelpers
.TryParseAsISO(sourceUnescaped, out DateTime tmp))
194
if (!
JsonHelpers
.IsValidDateTimeOffsetParseLength(segment.Length))
208
if (
JsonHelpers
.TryParseAsISO(segment, out DateTimeOffset tmp))
229
if (
JsonHelpers
.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length)
230
&&
JsonHelpers
.TryParseAsISO(sourceUnescaped, out DateTimeOffset tmp))
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (3)
451
if (
JsonHelpers
.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.LowSurrogateEndValue))
459
Debug.Assert(
JsonHelpers
.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue));
475
if (!
JsonHelpers
.IsInRangeInclusive((uint)lowSurrogate, JsonConstants.LowSurrogateStartValue, JsonConstants.LowSurrogateEndValue))
System\Text\Json\Reader\Utf8JsonReader.cs (7)
986
if (
JsonHelpers
.IsDigit(first) || first == '-')
1094
else if (
JsonHelpers
.IsDigit(marker) || marker == '-')
1589
if (!
JsonHelpers
.IsDigit(nextByte))
1630
JsonHelpers
.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound,
1643
if (!
JsonHelpers
.IsDigit(nextByte))
1682
if (!
JsonHelpers
.IsDigit(nextByte))
1720
if (!
JsonHelpers
.IsDigit(nextByte))
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (8)
358
if (
JsonHelpers
.IsDigit(first) || first == '-')
420
else if (
JsonHelpers
.IsDigit(marker) || marker == '-')
1275
if (!
JsonHelpers
.IsDigit(nextByte))
1333
JsonHelpers
.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound,
1347
if (!
JsonHelpers
.IsDigit(nextByte))
1385
if (!
JsonHelpers
.IsDigit(nextByte))
1442
if (!
JsonHelpers
.IsDigit(nextByte))
1507
if (!
JsonHelpers
.IsDigit(nextByte))
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (2)
1251
if (!
JsonHelpers
.IsInRangeInclusive(sequenceLength, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength))
1296
if (!
JsonHelpers
.IsInRangeInclusive(sequenceLength, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength))
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
58
!
JsonHelpers
.RequiresSpecialNumberHandlingOnWrite(state.Current.NumberHandling) &&
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
20
if (!
JsonHelpers
.IsInRangeInclusive(reader.ValueLength, 1, MaxEscapedCharacterLength))
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (2)
33
if (!
JsonHelpers
.IsInRangeInclusive(reader.ValueLength, FormatLength, MaxEscapedFormatLength))
57
if (!
JsonHelpers
.TryParseAsIso(source, out DateOnly value))
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
264
if (
JsonHelpers
.IntegerRegex.IsMatch(source))
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (2)
37
if (!
JsonHelpers
.IsInRangeInclusive(reader.ValueLength, MinimumTimeOnlyFormatLength, MaximumEscapedTimeOnlyFormatLength))
56
if (!
JsonHelpers
.IsDigit(firstChar) || firstSeparator < 0 || source[firstSeparator] == (byte)'.')
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (2)
37
if (!
JsonHelpers
.IsInRangeInclusive(reader.ValueLength, MinimumTimeSpanFormatLength, MaximumEscapedTimeSpanFormatLength))
55
if (!
JsonHelpers
.IsDigit(firstChar) && firstChar != '-')
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (1)
85
JsonHelpers
.IsInRangeInclusive((int)handling, 0,
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
65
!
JsonHelpers
.RequiresSpecialNumberHandlingOnWrite(options.NumberHandling) &&
System\Text\Json\Serialization\JsonUnionTypeStructuralClassifier.cs (1)
125
Dictionary<byte[], List<PocoPropertyClassifierInfo>> pocoPropertyIndex = new(
JsonHelpers
.ByteArrayOrdinalComparer.Instance);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (1)
463
Type[] sortedTypesWithRoot =
JsonHelpers
.TraverseGraphWithTopologicalSort(root, GetInheritanceRelatedTypes);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
486
EscapedNameSection =
JsonHelpers
.GetEscapedPropertyNameSection(NameAsUtf8Bytes, Options.Encoder);
System\Text\Json\Writer\JsonWriterHelper.cs (3)
177
while (i < utf8FormattedNumber.Length &&
JsonHelpers
.IsDigit(utf8FormattedNumber[i]))
200
while (i < utf8FormattedNumber.Length &&
JsonHelpers
.IsDigit(utf8FormattedNumber[i]))
242
while (i < utf8FormattedNumber.Length &&
JsonHelpers
.IsDigit(utf8FormattedNumber[i]))
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
1224
JsonHelpers
.ValidateInt32MaxArrayLength((uint)needed);