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

◆ ConsumeDecimalDigitsMultiSegment()

ConsumeNumberResult System.Text.Json.Utf8JsonReader.ConsumeDecimalDigitsMultiSegment ( ref ReadOnlySpan< byte > data,
ref int i,
in PartialStateForRollback rollBackState )
inlineprivate

Definition at line 3073 of file Utf8JsonReader.cs.

3074 {
3075 if (i >= data.Length)
3076 {
3077 if (IsLastSpan)
3078 {
3080 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData, 0);
3081 }
3082 if (!GetNextSpan())
3083 {
3084 if (IsLastSpan)
3085 {
3087 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData, 0);
3088 }
3089 return ConsumeNumberResult.NeedMoreData;
3090 }
3091 _totalConsumed += i;
3092 HasValueSequence = true;
3093 i = 0;
3094 data = _buffer;
3095 }
3096 byte b = data[i];
3097 if (!JsonHelpers.IsDigit(b))
3098 {
3100 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterDecimal, b);
3101 }
3102 i++;
3105 }
ConsumeNumberResult ConsumeIntegerDigitsMultiSegment(ref ReadOnlySpan< byte > data, ref int i)
void RollBackState(in PartialStateForRollback state, bool isError=false)

References System.Text.Json.Utf8JsonReader._buffer, System.Text.Json.Utf8JsonReader._bytePositionInLine, System.Text.Json.Utf8JsonReader._totalConsumed, System.Text.Json.Utf8JsonReader.ConsumeIntegerDigitsMultiSegment(), System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.GetNextSpan(), System.Text.Json.Utf8JsonReader.HasValueSequence, System.Text.Json.JsonHelpers.IsDigit(), System.Text.Json.Utf8JsonReader.IsLastSpan, System.Text.Json.Utf8JsonReader.RollBackState(), and System.Text.Json.ThrowHelper.ThrowJsonReaderException().

Referenced by System.Text.Json.Utf8JsonReader.TryGetNumberMultiSegment().