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

◆ TryGetValue() [3/15]

bool System.Text.Json.JsonDocument.TryGetValue ( int index,
out DateTime value )
inlinepackage

Definition at line 726 of file JsonDocument.cs.

727 {
729 DbRow dbRow = _parsedData.Get(index);
730 CheckExpectedType(JsonTokenType.String, dbRow.TokenType);
731 ReadOnlySpan<byte> source = _utf8Json.Span.Slice(dbRow.Location, dbRow.SizeOrLength);
732 if (!JsonHelpers.IsValidDateTimeOffsetParseLength(source.Length))
733 {
734 value = default(DateTime);
735 return false;
736 }
737 if (dbRow.HasComplexChildren)
738 {
739 return JsonReaderHelper.TryGetEscapedDateTime(source, out value);
740 }
741 if (JsonHelpers.TryParseAsISO(source, out DateTime value2))
742 {
743 value = value2;
744 return true;
745 }
746 value = default(DateTime);
747 return false;
748 }
void CheckExpectedType(JsonTokenType expected, JsonTokenType actual)
ReadOnlyMemory< byte > _utf8Json
unsafe ReadOnlySpan< T > Span

References System.Text.Json.JsonDocument._parsedData, System.Text.Json.JsonDocument._utf8Json, System.Text.Json.JsonDocument.CheckExpectedType(), System.Text.Json.JsonDocument.CheckNotDisposed(), System.Text.Json.Dictionary, System.Text.Json.JsonDocument.MetadataDb.Get(), System.index, System.Text.Json.JsonHelpers.IsValidDateTimeOffsetParseLength(), System.source, System.ReadOnlyMemory< T >.Span, System.Text.Json.JsonReaderHelper.TryGetEscapedDateTime(), System.Text.Json.JsonHelpers.TryParseAsISO(), and System.value.