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

◆ TryGetValue() [4/15]

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

Definition at line 750 of file JsonDocument.cs.

751 {
753 DbRow dbRow = _parsedData.Get(index);
754 CheckExpectedType(JsonTokenType.String, dbRow.TokenType);
755 ReadOnlySpan<byte> source = _utf8Json.Span.Slice(dbRow.Location, dbRow.SizeOrLength);
756 if (!JsonHelpers.IsValidDateTimeOffsetParseLength(source.Length))
757 {
758 value = default(DateTimeOffset);
759 return false;
760 }
761 if (dbRow.HasComplexChildren)
762 {
763 return JsonReaderHelper.TryGetEscapedDateTimeOffset(source, out value);
764 }
765 if (JsonHelpers.TryParseAsISO(source, out DateTimeOffset value2))
766 {
767 value = value2;
768 return true;
769 }
770 value = default(DateTimeOffset);
771 return false;
772 }
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.TryGetEscapedDateTimeOffset(), System.Text.Json.JsonHelpers.TryParseAsISO(), and System.value.