<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<!-- For the inbox library (that is shipping with the product), this should always be true. -->
- <!-- BUILDING_INBOX_LIBRARY is only false when building for netstandard to validate that the sources are netstandard compatible. -->
- <!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
+ <!-- BUILDING_INBOX_LIBRARY is only false when building the netstandard compatible NuGet package. -->
<DefineConstants Condition="'$(TargetsNETStandard)' != 'true'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants>
<!-- Workaround for overriding the XML comments related warnings that are being supressed repo wide (within arcade): -->
<!-- https://github.com/dotnet/arcade/blob/ea6addfdc65e5df1b2c036f11614a5f922e36267/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props#L90 -->
{
public sealed partial class JsonDocument
{
- /// <summary>
- /// This is an implementation detail and MUST NOT be used by source-package consumers.
- /// </summary>
[StructLayout(LayoutKind.Sequential)]
internal struct DbRow
{
{
public sealed partial class JsonDocument
{
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<char> propertyName, out JsonElement value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<byte> propertyName, out JsonElement value)
{
CheckNotDisposed();
private byte[] _extraRentedBytes;
private (int, string) _lastIndexAndString = (-1, null);
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool IsDisposable { get; }
/// <summary>
}
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal JsonTokenType GetJsonTokenType(int index)
{
CheckNotDisposed();
return _parsedData.GetJsonTokenType(index);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal int GetArrayLength(int index)
{
CheckNotDisposed();
return row.SizeOrLength;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal JsonElement GetArrayIndexElement(int currentIndex, int arrayIndex)
{
CheckNotDisposed();
throw new IndexOutOfRangeException();
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal int GetEndIndex(int index, bool includeEndElement)
{
CheckNotDisposed();
return _utf8Json.Slice(start, end - start);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetString(int index, JsonTokenType expectedType)
{
CheckNotDisposed();
return lastString;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetNameOfPropertyValue(int index)
{
// The property name is one row before the property value
return GetString(index - DbRow.Size, JsonTokenType.PropertyName);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out int value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out uint value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out long value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out ulong value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out double value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out float value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out decimal value)
{
CheckNotDisposed();
return false;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out DateTime value)
{
CheckNotDisposed();
&& segment.Length == bytesConsumed;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out DateTimeOffset value)
{
CheckNotDisposed();
&& segment.Length == bytesConsumed;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal bool TryGetValue(int index, out Guid value)
{
CheckNotDisposed();
return (segment.Length == JsonConstants.MaximumFormatGuidLength) && Utf8Parser.TryParse(segment, out value, out _, 'D');
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetRawValueAsString(int index)
{
ReadOnlyMemory<byte> segment = GetRawValue(index, includeQuotes: true);
return JsonReaderHelper.TranscodeHelper(segment.Span);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetPropertyRawValueAsString(int valueIndex)
{
ReadOnlyMemory<byte> segment = GetPropertyRawValue(valueIndex);
return JsonReaderHelper.TranscodeHelper(segment.Span);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal JsonElement CloneElement(int index)
{
int endIndex = GetEndIndex(index, true);
return newDocument.RootElement;
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal void WriteElementTo(
int index,
Utf8JsonWriter writer,
Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal void WriteElementTo(
int index,
Utf8JsonWriter writer,
Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal void WriteElementTo(
int index,
Utf8JsonWriter writer)
private int _curIdx;
private readonly int _endIdx;
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal ArrayEnumerator(JsonElement target)
{
Debug.Assert(target.TokenType == JsonTokenType.StartArray);
private int _curIdx;
private readonly int _endIdx;
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal ObjectEnumerator(JsonElement target)
{
Debug.Assert(target.TokenType == JsonTokenType.StartObject);
private readonly JsonDocument _parent;
private readonly int _idx;
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal JsonElement(JsonDocument parent, int idx)
{
// parent is usually not null, but the Current property
throw new FormatException();
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetPropertyName()
{
CheckValidInstance();
return _parent.GetRawValueAsString(_idx);
}
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal string GetPropertyRawText()
{
CheckValidInstance();
/// </summary>
public JsonElement Value { get; }
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal JsonProperty(JsonElement value)
{
Value = value;
namespace System.Text.Json.Serialization
{
- /// <summary>
- /// This is an implementation detail and MUST NOT be called by source-package consumers.
- /// </summary>
internal sealed class PooledByteBufferWriter : IBufferWriter<byte>, IDisposable
{
private byte[] _rentedBuffer;
<BuildConfigurations>
netcoreapp;
uap-Windows_NT;
- <!-- Only included for testing and validating that the sources are netstandard compatible. -->
- <!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
netstandard;
</BuildConfigurations>
</PropertyGroup>
new object[] {"{}", 0},
new object[] {"12345", 0},
new object[] {"1", 0},
+ new object[] {"-0", 0},
+ new object[] {"0.0e-0", 0},
+ new object[] {"0.0e+0", 0},
new object[] {"true", 0},
new object[] {"false", 0},
new object[] {"null", 0},
new object[] {" {}", 2},
new object[] {" 12345", 2},
new object[] {" 1", 2},
+ new object[] {" -0", 2},
+ new object[] {" 0.0e-0", 2},
+ new object[] {" 0.0e+0", 2},
new object[] {" true", 2},
new object[] {" false", 2},
new object[] {" null", 2},
new object[] {" {} ", 2},
new object[] {" 12345 ", 2},
new object[] {" 1 ", 2},
+ new object[] {" -0 ", 2},
+ new object[] {" 0.0e-0 ", 2},
+ new object[] {" 0.0e+0 ", 2},
new object[] {" true ", 2},
new object[] {" false ", 2},
new object[] {" null ", 2},
new object[] {"\"\\u12$3\"", 0, 5},
new object[] {"\"\\u12\"", 0, 5},
new object[] {"\"\\u120\"", 0, 6},
+ new object[] {"+0", 0, 0},
+ new object[] {"+1", 0, 0},
+ new object[] {"0e", 0, 2},
+ new object[] {"0.", 0, 2},
+ new object[] {"0.1e", 0, 4},
new object[] {"01", 0, 1},
new object[] {"1a", 0, 1},
new object[] {"-01", 0, 2},
new object[] {"10.5e", 0, 5},
new object[] {"10.5e-", 0, 6},
+ new object[] {"10.5e+", 0, 6},
new object[] {"10.5e-0.2", 0, 7},
new object[] {"{\"age\":30, \"ints\":[1, 2, 3, 4, 5.1e7.3]}", 0, 36},
new object[] {"{\"age\":30, \r\n \"num\":-0.e, \r\n \"ints\":[1, 2, 3, 4, 5]}", 1, 10},