10 writes to charsUsed
System.Private.Xml (10)
System\Xml\Core\XmlTextReaderImpl.cs (6)
2957
_ps.
charsUsed
= len;
3319
_ps.
charsUsed
= _ps.charPos;
3401
_ps.
charsUsed
= copyCharsCount;
3466
_ps.
charsUsed
+= charsRead;
3513
_ps.
charsUsed
+= charsCount;
8865
_ps.
charsUsed
--;
System\Xml\Core\XmlTextReaderImplAsync.cs (3)
1089
_ps.
charsUsed
= copyCharsCount;
1150
_ps.
charsUsed
+= charsRead;
5247
_ps.
charsUsed
--;
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
69
charsUsed
= 0;
213 references to charsUsed
System.Private.Xml (213)
System\Xml\Core\XmlTextReaderImpl.cs (125)
1508
if (_ps.
charsUsed
- _ps.charPos == 0)
1529
if (_ps.
charsUsed
- _ps.charPos == 0 && !_ps.entity!.IsExternal)
2191
_stringBuilder.Append(_ps.chars, _ps.charPos, _ps.
charsUsed
- _ps.charPos);
2192
_ps.charPos = _ps.
charsUsed
;
2392
return _ps.
charsUsed
;
2404
Debug.Assert(value >= 0 && value <= _ps.
charsUsed
);
2842
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.textReader == null);
2917
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.stream == null);
2947
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0);
3288
Debug.Assert(_ps.
charsUsed
>= _ps.charPos, "The current position must be in the valid character range.");
3296
Debug.Assert(_charactersInDocument >= _ps.
charsUsed
- _ps.charPos,
3298
_charactersInDocument -= _ps.
charsUsed
- _ps.charPos;
3305
Debug.Assert(_charactersFromEntities >= _ps.
charsUsed
- _ps.charPos,
3307
_charactersFromEntities -= _ps.
charsUsed
- _ps.charPos;
3346
if (_ps.
charsUsed
== _ps.chars.Length - 1)
3374
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3383
if (charsLen - _ps.
charsUsed
<= charsLen / 2)
3392
int copyCharsCount = _ps.
charsUsed
- _ps.charPos;
3431
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3465
charsRead = _ps.textReader.Read(_ps.chars, _ps.
charsUsed
, _ps.chars.Length - _ps.
charsUsed
- 1);
3477
Debug.Assert(_ps.
charsUsed
< _ps.chars.Length);
3481
_ps.chars[_ps.
charsUsed
] = (char)0;
3490
Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.
charsUsed
- 1);
3504
_ps.decoder.Convert(_ps.bytes, _ps.bytePos, bytesCount, _ps.chars, _ps.
charsUsed
, maxCharsCount, false, out bytesCount, out charsCount, out completed);
3532
_ps.decoder.Convert(_ps.bytes, _ps.bytePos + bytesDecoded, 1, _ps.chars, _ps.
charsUsed
+ charsDecoded, 2, false, out bDec, out chDec, out completed);
3545
Throw(_ps.
charsUsed
, SR.Xml_InvalidCharInThisEncoding);
3586
while (_ps.
charsUsed
- _ps.charPos < 6)
3673
else if (_ps.charPos + 1 == _ps.
charsUsed
)
3839
else if (pos == _ps.
charsUsed
)
3902
if (_ps.
charsUsed
- pos < 4) // minimum "<a/>"
3917
if (_ps.
charsUsed
- pos < 2) // minimum characters expected "--"
3942
if (_ps.
charsUsed
- pos < 6)
4049
else if (pos == _ps.
charsUsed
|| ((_v1Compat || mangoQuirks) && chars[pos] == 0x0))
4077
Debug.Assert(pos == _ps.
charsUsed
&& !_ps.isEof);
4139
if (_ps.
charsUsed
- pos < 2)
4162
if (_ps.
charsUsed
- pos < 6)
4196
if (pos + 1 == _ps.
charsUsed
)
4217
if (pos == _ps.
charsUsed
)
4236
if (_ps.
charsUsed
- _ps.charPos != 0)
4262
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF1);
4286
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOFInElementContent, _stringBuilder.ToString());
4349
else if (pos + 1 < _ps.
charsUsed
)
4411
if (pos + 1 == _ps.
charsUsed
)
4436
Throw(pos, SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4536
while (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
4575
if (pos == _ps.
charsUsed
)
4602
else if (pos == _ps.
charsUsed
&& !_ps.isEof)
4616
else if (pos == _ps.
charsUsed
)
4701
else if (pos + 1 != _ps.
charsUsed
)
4737
if (pos + 1 == _ps.
charsUsed
)
4754
else if (pos == _ps.
charsUsed
)
4760
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4830
else if (pos + 1 >= _ps.
charsUsed
)
5147
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5277
if (pos == _ps.
charsUsed
)
5287
if (pos + 1 == _ps.
charsUsed
)
5298
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
5308
if (_ps.
charsUsed
- _ps.charPos > 0)
5592
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5666
if (_ps.
charsUsed
- pos < 3 && !_ps.isEof)
5679
if (pos == _ps.
charsUsed
)
5689
if (pos + 1 == _ps.
charsUsed
)
5709
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos + offset);
5723
if (_ps.
charsUsed
- _ps.charPos > 0)
5908
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5917
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5935
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos);
5955
if (_ps.charPos + 1 == _ps.
charsUsed
)
6230
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
6233
if (_ps.
charsUsed
- _ps.charPos < 2)
6239
Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.
charsUsed
, _ps.charPos));
6300
if (_ps.
charsUsed
- _ps.charPos < 2)
6304
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF, "PI");
6342
else if (pos + 1 == _ps.
charsUsed
)
6383
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6405
if (pos == _ps.
charsUsed
)
6415
if (pos + 1 == _ps.
charsUsed
)
6426
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6504
if (_ps.
charsUsed
- _ps.charPos < 3)
6549
else if (pos + 2 == _ps.
charsUsed
)
6558
else if (pos + 1 == _ps.
charsUsed
)
6601
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6623
if (pos == _ps.
charsUsed
)
6631
if (pos + 1 == _ps.
charsUsed
)
6642
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6673
while (_ps.
charsUsed
- _ps.charPos < 8)
6755
while (_ps.
charsUsed
- _ps.charPos < 6)
6792
while (_ps.
charsUsed
- _ps.charPos < 6)
6901
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6927
if (pos + 3 >= _ps.
charsUsed
&& !_ps.isEof)
6942
else if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
6952
if (pos + 2 >= _ps.
charsUsed
&& !_ps.isEof)
6970
if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
7011
if (pos == _ps.
charsUsed
)
7021
if (pos + 1 == _ps.
charsUsed
)
7032
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
7041
if (_ps.
charsUsed
- _ps.charPos > 0)
7092
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
7111
if (pos == _ps.
charsUsed
)
7140
if (_ps.
charsUsed
- _ps.charPos == 0)
7244
else if (pos < _ps.
charsUsed
)
7273
if (pos == _ps.
charsUsed
)
7376
Debug.Assert(startPos < _ps.
charsUsed
);
7393
if (_ps.
charsUsed
- pos >= 3)
7410
if (_ps.
charsUsed
- pos >= 4)
7425
else if (pos < _ps.
charsUsed
)
7432
if (_ps.
charsUsed
- pos >= 5)
7449
if (_ps.
charsUsed
- pos >= 3)
7465
if (_ps.
charsUsed
- pos >= 3)
7522
if (pos + 1 >= _ps.
charsUsed
)
7532
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
7571
else if (pos == _ps.
charsUsed
)
8315
else if (pos + 1 < _ps.
charsUsed
)
8332
if (_ps.
charsUsed
- pos < 2)
8345
if (_ps.
charsUsed
- pos < 4)
8355
if (_ps.
charsUsed
- pos < 9)
8437
if (_ps.
charsUsed
- pos < 2)
8476
if (pos == _ps.
charsUsed
)
8652
if (pos == _ps.
charsUsed
)
8662
if (pos + 1 == _ps.
charsUsed
)
8675
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
8778
if (_ps.charPos == _ps.
charsUsed
)
8796
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
8863
if (_v1Compat && pos == _ps.
charsUsed
- 1 && _ps.chars[pos] == (char)0 && ReadData() == 0 && _ps.isStreamEof)
System\Xml\Core\XmlTextReaderImplAsync.cs (88)
868
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.textReader == null);
944
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.stream == null);
1035
if (_ps.
charsUsed
== _ps.chars.Length - 1)
1062
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
1071
if (charsLen - _ps.
charsUsed
<= charsLen / 2)
1080
int copyCharsCount = _ps.
charsUsed
- _ps.charPos;
1117
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
1149
charsRead = await _ps.textReader.ReadAsync(_ps.chars.AsMemory(_ps.
charsUsed
, _ps.chars.Length - _ps.
charsUsed
- 1)).ConfigureAwait(false);
1161
Debug.Assert(_ps.
charsUsed
< _ps.chars.Length);
1164
_ps.chars[_ps.
charsUsed
] = (char)0;
1171
while (_ps.
charsUsed
- _ps.charPos < 6)
1257
else if (_ps.charPos + 1 == _ps.
charsUsed
)
1418
else if (pos == _ps.
charsUsed
)
1481
if (_ps.
charsUsed
- pos < 4) // minimum "<a/>"
1492
if (_ps.
charsUsed
- pos < 2) // minimum characters expected "--"
1513
if (_ps.
charsUsed
- pos < 6)
1580
else if (pos == _ps.
charsUsed
|| (_v1Compat && chars[pos] == 0x0))
1597
Debug.Assert(pos == _ps.
charsUsed
&& !_ps.isEof);
1748
if (_ps.
charsUsed
- pos < 2)
1767
if (_ps.
charsUsed
- pos < 6)
1799
if (pos + 1 == _ps.
charsUsed
)
1815
if (pos == _ps.
charsUsed
)
1833
if (_ps.
charsUsed
- _ps.charPos != 0)
1913
else if (pos + 1 < _ps.
charsUsed
)
2015
if (pos + 1 == _ps.
charsUsed
)
2035
Throw(pos, SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
2067
if (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
2089
while (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
2190
if (pos == _ps.
charsUsed
)
2225
else if (pos == _ps.
charsUsed
&& !_ps.isEof)
2239
else if (pos == _ps.
charsUsed
)
2334
else if (pos + 1 != _ps.
charsUsed
)
2370
if (pos + 1 == _ps.
charsUsed
)
2387
else if (pos == _ps.
charsUsed
)
2393
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
2469
else if (pos + 1 >= _ps.
charsUsed
)
2657
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
2792
if (pos == _ps.
charsUsed
)
2802
if (pos + 1 == _ps.
charsUsed
)
2813
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
2823
if (_ps.
charsUsed
- _ps.charPos > 0)
3291
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
3318
if (_ps.
charsUsed
- pos < 3 && !_ps.isEof)
3333
if (pos == _ps.
charsUsed
)
3425
if (pos + 1 == _ps.
charsUsed
)
3452
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos + offset);
3469
if (_ps.
charsUsed
- _ps.charPos > 0)
3684
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || await ZeroEndingStreamAsync(_ps.charPos).ConfigureAwait(false))
3693
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || await ZeroEndingStreamAsync(_ps.charPos).ConfigureAwait(false))
3711
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos);
3731
if (_ps.charPos + 1 == _ps.
charsUsed
)
3934
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
3937
if (_ps.
charsUsed
- _ps.charPos < 2)
3943
Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.
charsUsed
, _ps.charPos));
4023
if (_ps.
charsUsed
- _ps.charPos < 2)
4027
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF, "PI");
4066
else if (pos + 1 == _ps.
charsUsed
)
4107
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4129
if (pos == _ps.
charsUsed
)
4139
if (pos + 1 == _ps.
charsUsed
)
4150
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4247
if (_ps.
charsUsed
- _ps.charPos < 3)
4292
else if (pos + 2 == _ps.
charsUsed
)
4301
else if (pos + 1 == _ps.
charsUsed
)
4344
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4366
if (pos == _ps.
charsUsed
)
4374
if (pos + 1 == _ps.
charsUsed
)
4385
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4417
while (_ps.
charsUsed
- _ps.charPos < 8)
4500
while (_ps.
charsUsed
- _ps.charPos < 6)
4537
while (_ps.
charsUsed
- _ps.charPos < 6)
4644
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4670
if (pos + 3 >= _ps.
charsUsed
&& !_ps.isEof)
4685
else if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
4695
if (pos + 2 >= _ps.
charsUsed
&& !_ps.isEof)
4713
if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
4754
if (pos == _ps.
charsUsed
)
4764
if (pos + 1 == _ps.
charsUsed
)
4775
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4784
if (_ps.
charsUsed
- _ps.charPos > 0)
4834
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4853
if (pos == _ps.
charsUsed
)
4882
if (_ps.
charsUsed
- _ps.charPos == 0)
4994
if (pos + 1 >= _ps.
charsUsed
)
5007
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
5046
else if (pos == _ps.
charsUsed
)
5245
if (_v1Compat && pos == _ps.
charsUsed
- 1 && _ps.chars[pos] == (char)0 && await ReadDataAsync().ConfigureAwait(false) == 0 && _ps.isStreamEof)