68 references to JsonHelpers
System.Text.Json (68)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (1)
343return JsonHelpers.TraverseGraphWithTopologicalSort(type, static t => t.GetInterfaces());
System\Text\Json\Document\JsonDocument.cs (4)
640if (!JsonHelpers.IsValidDateTimeOffsetParseLength(segment.Length)) 654if (JsonHelpers.TryParseAsISO(segment, out DateTime tmp)) 675if (!JsonHelpers.IsValidDateTimeOffsetParseLength(segment.Length)) 689if (JsonHelpers.TryParseAsISO(segment, out DateTimeOffset tmp))
System\Text\Json\JsonEncodedText.cs (1)
133return new JsonEncodedText(JsonHelpers.EscapeValue(utf8Value, idx, encoder));
System\Text\Json\JsonPropertyDictionary.cs (1)
320_propertyDictionary = JsonHelpers.CreateDictionaryFromCollection(_propertyList, _stringComparer);
System\Text\Json\Nodes\JsonNode.To.cs (2)
30return JsonHelpers.Utf8GetString(output.WrittenMemory.Span); 64return 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)
495if (JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.LowSurrogateEndValue)) 503Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 519if (!JsonHelpers.IsInRangeInclusive((uint)lowSurrogate, JsonConstants.LowSurrogateStartValue, JsonConstants.LowSurrogateEndValue))
System\Text\Json\Reader\Utf8JsonReader.cs (7)
985if (JsonHelpers.IsDigit(first) || first == '-') 1063else if (JsonHelpers.IsDigit(marker) || marker == '-') 1559if (!JsonHelpers.IsDigit(nextByte)) 1600JsonHelpers.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound, 1613if (!JsonHelpers.IsDigit(nextByte)) 1652if (!JsonHelpers.IsDigit(nextByte)) 1690if (!JsonHelpers.IsDigit(nextByte))
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (8)
358if (JsonHelpers.IsDigit(first) || first == '-') 424else if (JsonHelpers.IsDigit(marker) || marker == '-') 1287if (!JsonHelpers.IsDigit(nextByte)) 1345JsonHelpers.IsInRangeInclusive(nextByte, '0', '9') ? ExceptionResource.InvalidLeadingZeroInNumber : ExceptionResource.ExpectedEndOfDigitNotFound, 1359if (!JsonHelpers.IsDigit(nextByte)) 1397if (!JsonHelpers.IsDigit(nextByte)) 1454if (!JsonHelpers.IsDigit(nextByte)) 1519if (!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)
55!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)
385if ((_converterOptions & EnumConverterOptions.AllowNumbers) != 0 || !JsonHelpers.IntegerRegex.IsMatch(source))
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (2)
35if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumTimeOnlyFormatLength, MaximumEscapedTimeOnlyFormatLength)) 54if (!JsonHelpers.IsDigit(firstChar) || firstSeparator < 0 || source[firstSeparator] == (byte)'.')
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (2)
35if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumTimeSpanFormatLength, MaximumEscapedTimeSpanFormatLength)) 53if (!JsonHelpers.IsDigit(firstChar) && firstChar != '-')
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (1)
38if (!JsonHelpers.IsInRangeInclusive(reader.ValueLength, MinimumVersionLength, MaximumEscapedVersionLength))
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (1)
85JsonHelpers.IsInRangeInclusive((int)handling, 0,
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (2)
55string stringPropertyName = JsonHelpers.Utf8GetString(unescapedPropertyName); 62state.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)
391EscapedNameSection = JsonHelpers.GetEscapedPropertyNameSection(NameAsUtf8Bytes, Options.Encoder);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (4)
167if (PropertyCache!.TryGetValue(JsonHelpers.Utf8GetString(propertyName), out JsonPropertyInfo? info)) 179string propertyNameStr = JsonHelpers.Utf8GetString(propertyName); 199string propertyNameStr = JsonHelpers.Utf8GetString(propertyName); 317if (ParameterCache.TryGetValue(JsonHelpers.Utf8GetString(propertyName), out JsonParameterInfo? info))
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
823string propertyName = JsonHelpers.Utf8GetString(unescapedPropertyName);
System\Text\Json\Serialization\ReadStack.cs (1)
364propertyName = JsonHelpers.Utf8GetString(utf8PropertyName);
System\Text\Json\ThrowHelper.cs (1)
339string message = GetResourceString(ref json, resource, nextByte, JsonHelpers.Utf8GetString(bytes));
System\Text\Json\ThrowHelper.Serialization.cs (1)
715ThrowJsonException(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);