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

◆ SkipCommentMultiSegment()

bool System.Text.Json.Utf8JsonReader.SkipCommentMultiSegment ( out int tailBytesToIgnore)
inlineprivate

Definition at line 3739 of file Utf8JsonReader.cs.

3740 {
3741 _consumed++;
3743 ReadOnlySpan<byte> localBuffer = _buffer.Slice(_consumed);
3744 if (localBuffer.Length == 0)
3745 {
3746 if (IsLastSpan)
3747 {
3748 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment, 0);
3749 }
3750 if (!GetNextSpan())
3751 {
3752 if (IsLastSpan)
3753 {
3754 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment, 0);
3755 }
3757 return false;
3758 }
3760 }
3761 byte b = localBuffer[0];
3762 if (b != 47 && b != 42)
3763 {
3764 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAtStartOfComment, b);
3765 }
3766 bool flag = b == 42;
3767 _consumed++;
3769 localBuffer = localBuffer.Slice(1);
3770 if (localBuffer.Length == 0)
3771 {
3772 if (IsLastSpan)
3773 {
3775 if (flag)
3776 {
3777 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment, 0);
3778 }
3779 return true;
3780 }
3781 if (!GetNextSpan())
3782 {
3784 if (IsLastSpan)
3785 {
3786 if (flag)
3787 {
3788 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment, 0);
3789 }
3790 return true;
3791 }
3792 return false;
3793 }
3795 }
3796 if (flag)
3797 {
3800 }
3802 }
ReadOnlySpan< T > Slice(int start)
bool SkipSingleLineCommentMultiSegment(ReadOnlySpan< byte > localBuffer, out int tailBytesToSkip)
bool SkipMultiLineCommentMultiSegment(ReadOnlySpan< byte > localBuffer)

References System.Text.Json.Utf8JsonReader._buffer, System.Text.Json.Utf8JsonReader._bytePositionInLine, System.Text.Json.Utf8JsonReader._consumed, System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.GetNextSpan(), System.Text.Json.Utf8JsonReader.IsLastSpan, System.Text.Json.Utf8JsonReader.SkipMultiLineCommentMultiSegment(), System.Text.Json.Utf8JsonReader.SkipSingleLineCommentMultiSegment(), System.ReadOnlySpan< T >.Slice(), and System.Text.Json.ThrowHelper.ThrowJsonReaderException().

Referenced by System.Text.Json.Utf8JsonReader.ConsumeValueMultiSegment(), and System.Text.Json.Utf8JsonReader.SkipOrConsumeCommentMultiSegmentWithRollback().