Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SkipComment()

bool System.Text.Json.Utf8JsonReader.SkipComment ( )
inlineprivate

Definition at line 1742 of file Utf8JsonReader.cs.

1743 {
1744 ReadOnlySpan<byte> readOnlySpan = _buffer.Slice(_consumed + 1);
1745 if (readOnlySpan.Length > 0)
1746 {
1747 int idx;
1748 switch (readOnlySpan[0])
1749 {
1750 case 47:
1751 return SkipSingleLineComment(readOnlySpan.Slice(1), out idx);
1752 case 42:
1753 return SkipMultiLineComment(readOnlySpan.Slice(1), out idx);
1754 }
1755 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, 47);
1756 }
1757 if (IsLastSpan)
1758 {
1759 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, 47);
1760 }
1761 return false;
1762 }
ReadOnlySpan< T > Slice(int start)
bool SkipSingleLineComment(ReadOnlySpan< byte > localBuffer, out int idx)
bool SkipMultiLineComment(ReadOnlySpan< byte > localBuffer, out int idx)

References System.Text.Json.Utf8JsonReader._buffer, System.Text.Json.Utf8JsonReader._consumed, System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.IsLastSpan, System.Text.Json.Utf8JsonReader.SkipMultiLineComment(), System.Text.Json.Utf8JsonReader.SkipSingleLineComment(), System.ReadOnlySpan< T >.Slice(), and System.Text.Json.ThrowHelper.ThrowJsonReaderException().

Referenced by System.Text.Json.Utf8JsonReader.ConsumeValue(), System.Text.Json.Utf8JsonReader.SkipAllComments(), and System.Text.Json.Utf8JsonReader.SkipAllComments().