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

◆ ConsumeString()

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

Definition at line 904 of file Utf8JsonReader.cs.

905 {
906 ReadOnlySpan<byte> readOnlySpan = _buffer.Slice(_consumed + 1);
907 int num = readOnlySpan.IndexOfQuoteOrAnyControlOrBackSlash();
908 if (num >= 0)
909 {
910 byte b = readOnlySpan[num];
911 if (b == 34)
912 {
913 _bytePositionInLine += num + 2;
914 ValueSpan = readOnlySpan.Slice(0, num);
915 _stringHasEscaping = false;
916 _tokenType = JsonTokenType.String;
917 _consumed += num + 2;
918 return true;
919 }
921 }
922 if (IsLastSpan)
923 {
925 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound, 0);
926 }
927 return false;
928 }
ReadOnlySpan< T > Slice(int start)
bool ConsumeStringAndValidate(ReadOnlySpan< byte > data, int idx)

References System.Text.Json.Utf8JsonReader._buffer, System.Text.Json.Utf8JsonReader._bytePositionInLine, System.Text.Json.Utf8JsonReader._consumed, System.Text.Json.Utf8JsonReader._stringHasEscaping, System.Text.Json.Utf8JsonReader._tokenType, System.Text.Json.Utf8JsonReader.ConsumeStringAndValidate(), System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.IsLastSpan, System.ReadOnlySpan< T >.Slice(), System.Text.Json.ThrowHelper.ThrowJsonReaderException(), and System.Text.Json.Utf8JsonReader.ValueSpan.

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