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

◆ GetSingleWithQuotes()

float System.Text.Json.Utf8JsonReader.GetSingleWithQuotes ( )
inlinepackage

Definition at line 4269 of file Utf8JsonReader.cs.

4270 {
4271 ReadOnlySpan<byte> unescapedSpan = GetUnescapedSpan();
4272 if (JsonReaderHelper.TryGetFloatingPointConstant(unescapedSpan, out float value))
4273 {
4274 return value;
4275 }
4276 if (Utf8Parser.TryParse(unescapedSpan, out value, out int bytesConsumed, '\0') && unescapedSpan.Length == bytesConsumed && JsonHelpers.IsFinite(value))
4277 {
4278 return value;
4279 }
4280 throw ThrowHelper.GetFormatException(NumericType.Single);
4281 }
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')
ReadOnlySpan< byte > GetUnescapedSpan()

References System.Text.Json.Dictionary, System.Text.Json.ThrowHelper.GetFormatException(), System.Text.Json.Utf8JsonReader.GetUnescapedSpan(), System.Text.Json.JsonHelpers.IsFinite(), System.Text.Json.JsonReaderHelper.TryGetFloatingPointConstant(), System.Buffers.Text.Utf8Parser.TryParse(), and System.value.