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

◆ WriteStringEscapeProperty() [8/8]

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

Definition at line 2934 of file Utf8JsonWriter.cs.

2935 {
2936 char[] array = null;
2937 if (firstEscapeIndexProp != -1)
2938 {
2939 int maxEscapedLength = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
2940 Span<char> destination;
2941 if (maxEscapedLength > 128)
2942 {
2945 }
2946 else
2947 {
2948 char* pointer = stackalloc char[128];
2949 destination = new Span<char>(pointer, 128);
2950 }
2951 JsonWriterHelper.EscapeString(propertyName, destination, firstEscapeIndexProp, _options.Encoder, out var written);
2952 propertyName = destination.Slice(0, written);
2953 }
2955 if (array != null)
2956 {
2958 }
2959 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
void WriteStringByOptionsPropertyName(ReadOnlySpan< char > propertyName)

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, and System.Text.Json.Utf8JsonWriter.WriteStringByOptionsPropertyName().