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

◆ TryGetDouble()

bool System.Text.Json.Utf8JsonReader.TryGetDouble ( out double value)
inline

Definition at line 4710 of file Utf8JsonReader.cs.

4711 {
4712 if (TokenType != JsonTokenType.Number)
4713 {
4714 throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType);
4715 }
4716 ReadOnlySpan<byte> readOnlySpan;
4717 if (!HasValueSequence)
4718 {
4720 }
4721 else
4722 {
4725 }
4726 ReadOnlySpan<byte> source = readOnlySpan;
4727 if (Utf8Parser.TryParse(source, out double value2, out int bytesConsumed, '\0') && source.Length == bytesConsumed)
4728 {
4729 value = value2;
4730 return true;
4731 }
4732 value = 0.0;
4733 return false;
4734 }
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')
ReadOnlySequence< byte > ValueSequence

References System.Text.Json.Dictionary, System.Text.Json.ThrowHelper.GetInvalidOperationException_ExpectedNumber(), System.Text.Json.Utf8JsonReader.HasValueSequence, System.source, System.Buffers.Text.Utf8Parser.TryParse(), System.value, System.Text.Json.Utf8JsonReader.ValueSequence, and System.Text.Json.Utf8JsonReader.ValueSpan.

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