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

◆ UnescapeString()

ReadOnlySpan< byte > System.Text.Json.JsonDocument.UnescapeString ( in DbRow row,
out ArraySegment< byte > rented )
inlineprivate

Definition at line 896 of file JsonDocument.cs.

897 {
898 int location = row.Location;
899 int sizeOrLength = row.SizeOrLength;
900 ReadOnlySpan<byte> span = _utf8Json.Slice(location, sizeOrLength).Span;
901 if (!row.HasComplexChildren)
902 {
903 rented = default(ArraySegment<byte>);
904 return span;
905 }
906 int num = span.IndexOf<byte>(92);
908 span.Slice(0, num).CopyTo(array);
909 JsonReaderHelper.Unescape(span, array, num, out var written);
910 rented = new ArraySegment<byte>(array, 0, written);
911 return rented.AsSpan();
912 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
ReadOnlyMemory< byte > _utf8Json
ReadOnlyMemory< T > Slice(int start)

References System.Text.Json.JsonDocument._utf8Json, System.array, System.Text.Json.Dictionary, System.Buffers.ArrayPool< T >.Shared, System.ReadOnlyMemory< T >.Slice(), and System.Text.Json.JsonReaderHelper.Unescape().

Referenced by System.Text.Json.JsonDocument.WritePropertyName(), and System.Text.Json.JsonDocument.WriteString().