1 write to _options
System.Text.Json (1)
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
250_options = options;
256 references to _options
System.Text.Json (256)
System\Text\Json\Writer\Utf8JsonWriter.cs (29)
106public JsonWriterOptions Options => _options; 251_indentByte = (byte)_options.IndentCharacter; 257if (_options.MaxDepth == 0) 259_options.MaxDepth = JsonWriterOptions.DefaultMaxDepth; // If max depth is not set, revert to the default depth. 571if (CurrentDepth >= _options.MaxDepth) 576if (_options.IndentedOrNotSkipValidation) 606Debug.Assert(_options.Indented || !_options.SkipValidation); 608if (_options.Indented) 610if (!_options.SkipValidation) 619Debug.Assert(!_options.SkipValidation); 665Debug.Assert(indent <= _indentLength * _options.MaxDepth); 784int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 802if (_options.Indented) 825JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 933int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 951if (_options.Indented) 974JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 1010if (_options.IndentedOrNotSkipValidation) 1040Debug.Assert(_options.Indented || !_options.SkipValidation); 1042if (_options.Indented) 1044if (!_options.SkipValidation) 1052Debug.Assert(!_options.SkipValidation); 1105Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1106Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1234=> ThrowHelper.ThrowInvalidOperationException(resource, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); 1239=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); 1244=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.DepthTooLarge, _currentDepth, _options.MaxDepth, token: default, tokenType: default);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (10)
104int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 120int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 147JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 170JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 183if (_options.Indented) 196if (_options.Indented) 280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 302Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (10)
111int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 127int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 154JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 177JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 190if (_options.Indented) 203if (_options.Indented) 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (10)
110int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 126int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 153JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 176JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 189if (_options.Indented) 202if (_options.Indented) 283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 303Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 332Debug.Assert(indent <= _indentLength * _options.MaxDepth); 351Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (10)
110int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 126int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 153JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 176JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 189if (_options.Indented) 202if (_options.Indented) 277Debug.Assert(indent <= _indentLength * _options.MaxDepth); 297Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 323Debug.Assert(indent <= _indentLength * _options.MaxDepth); 342Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (10)
114int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 130int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 157JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 180JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 193if (_options.Indented) 206if (_options.Indented) 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (10)
114int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 130int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 157JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 180JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 193if (_options.Indented) 206if (_options.Indented) 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (6)
84int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 100int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 127JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 150JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 163if (_options.Indented) 176if (_options.Indented)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (10)
110int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 126int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 153JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 176JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 189if (_options.Indented) 202if (_options.Indented) 285Debug.Assert(indent <= _indentLength * _options.MaxDepth); 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth); 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (12)
17if (propertyName.Length > JsonConstants.MaxCharacterTokenSize || CurrentDepth >= _options.MaxDepth) 18ThrowHelper.ThrowInvalidOperationOrArgumentException(propertyName, _currentDepth, _options.MaxDepth); 24if (utf8PropertyName.Length > JsonConstants.MaxUnescapedTokenSize || CurrentDepth >= _options.MaxDepth) 25ThrowHelper.ThrowInvalidOperationOrArgumentException(utf8PropertyName, _currentDepth, _options.MaxDepth); 31if (CurrentDepth >= _options.MaxDepth) 32ThrowHelper.ThrowInvalidOperationException(_currentDepth, _options.MaxDepth); 38if (!_options.SkipValidation) 51if (!_options.SkipValidation) 106Debug.Assert(indent <= _indentLength * _options.MaxDepth); 125Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 178Debug.Assert(indent <= _indentLength * _options.MaxDepth); 198Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (11)
28if (_options.Indented) 229int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 245int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 272JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 295JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 308if (_options.Indented) 321if (_options.Indented) 424Debug.Assert(indent <= _indentLength * _options.MaxDepth); 445Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 470Debug.Assert(indent <= _indentLength * _options.MaxDepth); 490Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (10)
183int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 199int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 226JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 249JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 262if (_options.Indented) 275if (_options.Indented) 350Debug.Assert(indent <= _indentLength * _options.MaxDepth); 370Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 396Debug.Assert(indent <= _indentLength * _options.MaxDepth); 415Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (46)
24if (_options.Indented) 93int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 131JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 146if (_options.Indented) 187Debug.Assert(indent <= _indentLength * _options.MaxDepth); 242int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 290JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 305if (_options.Indented) 375Debug.Assert(indent <= _indentLength * _options.MaxDepth); 395Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 599int valueIdx = JsonWriterHelper.NeedsEscaping(value, _options.Encoder); 686int valueIdx = JsonWriterHelper.NeedsEscaping(utf8Value, _options.Encoder); 773int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 845int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 907JsonWriterHelper.EscapeString(utf8Value, escapedValue, firstEscapeIndex, _options.Encoder, out int written); 930JsonWriterHelper.EscapeString(value, escapedValue, firstEscapeIndex, _options.Encoder, out int written); 953JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndex, _options.Encoder, out int written); 976JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndex, _options.Encoder, out int written); 988int valueIdx = JsonWriterHelper.NeedsEscaping(value, _options.Encoder); 989int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 1007int valueIdx = JsonWriterHelper.NeedsEscaping(utf8Value, _options.Encoder); 1008int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 1026int valueIdx = JsonWriterHelper.NeedsEscaping(utf8Value, _options.Encoder); 1027int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 1045int valueIdx = JsonWriterHelper.NeedsEscaping(value, _options.Encoder); 1046int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 1085JsonWriterHelper.EscapeString(value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written); 1105JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 1145JsonWriterHelper.EscapeString(utf8Value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written); 1165JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 1205JsonWriterHelper.EscapeString(utf8Value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written); 1225JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 1265JsonWriterHelper.EscapeString(value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written); 1285JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 1305if (_options.Indented) 1318if (_options.Indented) 1331if (_options.Indented) 1344if (_options.Indented) 1501Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1522Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1551Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1571Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1602Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1623Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1653Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1674Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (10)
192int propertyIdx = JsonWriterHelper.NeedsEscaping(propertyName, _options.Encoder); 208int propertyIdx = JsonWriterHelper.NeedsEscaping(utf8PropertyName, _options.Encoder); 235JsonWriterHelper.EscapeString(propertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 258JsonWriterHelper.EscapeString(utf8PropertyName, escapedPropertyName, firstEscapeIndexProp, _options.Encoder, out int written); 271if (_options.Indented) 284if (_options.Indented) 359Debug.Assert(indent <= _indentLength * _options.MaxDepth); 379Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 405Debug.Assert(indent <= _indentLength * _options.MaxDepth); 424Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (3)
34if (!_options.SkipValidation) 39if (_options.Indented) 91Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (5)
61if (!_options.SkipValidation) 68if (_options.Indented) 112Debug.Assert(indent <= _indentLength * _options.MaxDepth); 183if (_options.Indented) 219Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (3)
24if (!_options.SkipValidation) 29if (_options.Indented) 69Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (3)
25if (!_options.SkipValidation) 30if (_options.Indented) 70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (3)
24if (!_options.SkipValidation) 29if (_options.Indented) 66Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (3)
28if (!_options.SkipValidation) 33if (_options.Indented) 70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (3)
28if (!_options.SkipValidation) 33if (_options.Indented) 70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (3)
29if (!_options.SkipValidation) 34if (_options.Indented) 70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (3)
24if (!_options.SkipValidation) 29if (_options.Indented) 70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (1)
54Debug.Assert(!_options.SkipValidation);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (3)
49if (!_options.SkipValidation) 54if (_options.Indented) 89Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (4)
36if (!_options.SkipValidation) 69if (!_options.SkipValidation) 100if (!_options.SkipValidation) 136if (!_options.SkipValidation)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (3)
37if (!_options.SkipValidation) 42if (_options.Indented) 79Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (10)
84int valueIdx = JsonWriterHelper.NeedsEscaping(value, _options.Encoder); 100if (!_options.SkipValidation) 105if (_options.Indented) 146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 196JsonWriterHelper.EscapeString(value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written); 231int valueIdx = JsonWriterHelper.NeedsEscaping(utf8Value, _options.Encoder); 247if (!_options.SkipValidation) 252if (_options.Indented) 293Debug.Assert(indent <= _indentLength * _options.MaxDepth); 343JsonWriterHelper.EscapeString(utf8Value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int written);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (9)
31if (!_options.SkipValidation) 122int escapeIdx = JsonWriterHelper.NeedsEscaping(value, _options.Encoder); 146JsonWriterHelper.EscapeString(value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int consumed, out int written, isFinalSegment); 199if (!_options.SkipValidation) 291int escapeIdx = JsonWriterHelper.NeedsEscaping(utf8Value, _options.Encoder); 312JsonWriterHelper.EscapeString(utf8Value, escapedValue, firstEscapeIndexVal, _options.Encoder, out int consumed, out int written, isFinalSegment); 366if (!_options.SkipValidation) 463if (_options.Indented) 476Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (3)
39if (!_options.SkipValidation) 44if (_options.Indented) 81Debug.Assert(indent <= _indentLength * _options.MaxDepth);