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

◆ WriteStringEscapePropertyOrValue() [4/4]

unsafe void System.Text.Json.Utf8JsonWriter.WriteStringEscapePropertyOrValue ( ReadOnlySpan< char > propertyName,
ReadOnlySpan< char > value,
int firstEscapeIndexProp,
int firstEscapeIndexVal )
inlineprivate

Definition at line 3456 of file Utf8JsonWriter.cs.

3457 {
3458 char[] array = null;
3459 char[] array2 = null;
3460 if (firstEscapeIndexVal != -1)
3461 {
3462 int maxEscapedLength = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndexVal);
3463 Span<char> destination;
3464 if (maxEscapedLength > 128)
3465 {
3468 }
3469 else
3470 {
3471 char* pointer = stackalloc char[128];
3472 destination = new Span<char>(pointer, 128);
3473 }
3474 JsonWriterHelper.EscapeString(value, destination, firstEscapeIndexVal, _options.Encoder, out var written);
3475 value = destination.Slice(0, written);
3476 }
3477 if (firstEscapeIndexProp != -1)
3478 {
3479 int maxEscapedLength2 = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
3480 Span<char> destination2;
3481 if (maxEscapedLength2 > 128)
3482 {
3485 }
3486 else
3487 {
3488 char* pointer2 = stackalloc char[128];
3489 destination2 = new Span<char>(pointer2, 128);
3490 }
3491 JsonWriterHelper.EscapeString(propertyName, destination2, firstEscapeIndexProp, _options.Encoder, out var written2);
3493 }
3495 if (array != null)
3496 {
3498 }
3499 if (array2 != null)
3500 {
3502 }
3503 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
void WriteStringByOptions(ReadOnlySpan< char > propertyName, DateTime value)

References System.Text.Json.Utf8JsonWriter._options, System.array, System.destination, System.Text.Json.Dictionary, System.Text.Json.JsonWriterOptions.Encoder, System.Text.Json.JsonWriterHelper.EscapeString(), System.Text.Json.JsonWriterHelper.GetMaxEscapedLength(), System.pointer, System.Buffers.ArrayPool< T >.Shared, System.value, and System.Text.Json.Utf8JsonWriter.WriteStringByOptions().

Referenced by System.Text.Json.Utf8JsonWriter.WriteStringEscape(), System.Text.Json.Utf8JsonWriter.WriteStringEscape(), System.Text.Json.Utf8JsonWriter.WriteStringEscape(), and System.Text.Json.Utf8JsonWriter.WriteStringEscape().