63 references to JsonHelpers
System.Text.Json (63)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (1)
343return JsonHelpers.TraverseGraphWithTopologicalSort(type, static t => t.GetInterfaces());
System\Text\Json\Document\JsonDocument.cs (4)
672if (!JsonHelpers.IsValidDateTimeOffsetParseLength(segment.Length)) 686if (JsonHelpers.TryParseAsISO(segment, out DateTime tmp)) 707if (!JsonHelpers.IsValidDateTimeOffsetParseLength(segment.Length)) 721if (JsonHelpers.TryParseAsISO(segment, out DateTimeOffset tmp))
System\Text\Json\Document\JsonElement.cs (1)
1285return JsonHelpers.AreEqualJsonNumbers(element1.GetRawValue().Span, element2.GetRawValue().Span);
System\Text\Json\JsonEncodedText.cs (1)
133return new JsonEncodedText(JsonHelpers.EscapeValue(utf8Value, idx, encoder));
System\Text\Json\Nodes\JsonNode.To.cs (2)
30return JsonHelpers.Utf8GetString(output.WrittenMemory.Span); 63return JsonHelpers.Utf8GetString(output.WrittenMemory.Span);
System\Text\Json\Reader\JsonReaderHelper.cs (4)
93if (JsonHelpers.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length) 94&& JsonHelpers.TryParseAsISO(sourceUnescaped, out DateTime tmp)) 115if (JsonHelpers.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length) 116&& JsonHelpers.TryParseAsISO(sourceUnescaped, out DateTimeOffset tmp))
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (3)
539if (JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.LowSurrogateEndValue)) 547Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 563if (!JsonHelpers.IsInRangeInclusive((uint)lowSurrogate, JsonConstants.LowSurrogateStartValue, JsonConstants.LowSurrogateEndValue))
System\Text\Json\Reader\Utf8JsonReader.cs (7)
986if (JsonHelpers.IsDigit(first) || first == '-') 1060else if (JsonHelpers.IsDigit(marker) || marker == '-') 1556if (!JsonHelpers.IsDigit(nextByte)) 1597JsonHelpers.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound, 1610if (!JsonHelpers.IsDigit(nextByte)) 1649if (!JsonHelpers.IsDigit(nextByte)) 1687if (!JsonHelpers.IsDigit(nextByte))
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (8)
358if (JsonHelpers.IsDigit(first) || first == '-') 420else if (JsonHelpers.IsDigit(marker) || marker == '-') 1283if (!JsonHelpers.IsDigit(nextByte)) 1341JsonHelpers.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound, 1355if (!JsonHelpers.IsDigit(nextByte)) 1393if (!JsonHelpers.IsDigit(nextByte)) 1450if (!JsonHelpers.IsDigit(nextByte)) 1515if (!JsonHelpers.IsDigit(nextByte))
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (8)
608&& JsonHelpers.IsFinite(value))) 665&& JsonHelpers.IsFinite(value))) 1251if (!JsonHelpers.IsInRangeInclusive(sequenceLength, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1263if (!JsonHelpers.IsInRangeInclusive(ValueSpan.Length, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1279if (JsonHelpers.TryParseAsISO(span, out DateTime tmp)) 1316if (!JsonHelpers.IsInRangeInclusive(sequenceLength, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1328if (!JsonHelpers.IsInRangeInclusive(ValueSpan.Length, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1344if (JsonHelpers.TryParseAsISO(span, out DateTimeOffset tmp))
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
58!JsonHelpers.RequiresSpecialNumberHandlingOnWrite(state.Current.NumberHandling) &&
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
20if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, 1, MaxEscapedCharacterLength))
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (2)
33if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, FormatLength, MaxEscapedFormatLength)) 50if (!JsonHelpers.TryParseAsIso(source, out DateOnly value))
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
264if (JsonHelpers.IntegerRegex.IsMatch(source))
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (2)
37if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumTimeOnlyFormatLength, MaximumEscapedTimeOnlyFormatLength)) 56if (!JsonHelpers.IsDigit(firstChar) || firstSeparator < 0 || source[firstSeparator] == (byte)'.')
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (2)
37if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumTimeSpanFormatLength, MaximumEscapedTimeSpanFormatLength)) 55if (!JsonHelpers.IsDigit(firstChar) && firstChar != '-')
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (1)
40if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumVersionLength, MaximumEscapedVersionLength))
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (1)
86JsonHelpers.IsInRangeInclusive((int)handling, 0,
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
47string stringPropertyName = JsonHelpers.Utf8GetString(unescapedPropertyName); 54state.Current.JsonPropertyNameAsString = JsonHelpers.Utf8GetString(unescapedPropertyName);
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
65!JsonHelpers.RequiresSpecialNumberHandlingOnWrite(options.NumberHandling) &&
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
491EscapedNameSection = JsonHelpers.GetEscapedPropertyNameSection(NameAsUtf8Bytes, Options.Encoder);
System\Text\Json\Serialization\ReadStack.cs (1)
364propertyName = JsonHelpers.Utf8GetString(utf8PropertyName);
System\Text\Json\ThrowHelper.cs (1)
357string message = GetResourceString(ref json, resource, nextByte, JsonHelpers.Utf8GetString(bytes));
System\Text\Json\ThrowHelper.Serialization.cs (1)
744ThrowJsonException(SR.Format(SR.DuplicateMetadataProperty, JsonHelpers.Utf8GetString(utf8PropertyName)));
System\Text\Json\Writer\JsonWriterHelper.cs (5)
80if (!JsonHelpers.IsFinite(value)) 89if (!JsonHelpers.IsFinite(value)) 178while (i < utf8FormattedNumber.Length && JsonHelpers.IsDigit(utf8FormattedNumber[i])) 201while (i < utf8FormattedNumber.Length && JsonHelpers.IsDigit(utf8FormattedNumber[i])) 243while (i < utf8FormattedNumber.Length && JsonHelpers.IsDigit(utf8FormattedNumber[i]))
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
1078JsonHelpers.ValidateInt32MaxArrayLength((uint)needed);