10 writes to charsUsed
System.Private.Xml (10)
System\Xml\Core\XmlTextReaderImpl.cs (6)
2957
_ps.
charsUsed
= len;
3336
_ps.
charsUsed
= _ps.charPos;
3418
_ps.
charsUsed
= copyCharsCount;
3483
_ps.
charsUsed
+= charsRead;
3530
_ps.
charsUsed
+= charsCount;
8882
_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;
3363
if (_ps.
charsUsed
== _ps.chars.Length - 1)
3391
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3400
if (charsLen - _ps.
charsUsed
<= charsLen / 2)
3409
int copyCharsCount = _ps.
charsUsed
- _ps.charPos;
3448
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3482
charsRead = _ps.textReader.Read(_ps.chars, _ps.
charsUsed
, _ps.chars.Length - _ps.
charsUsed
- 1);
3494
Debug.Assert(_ps.
charsUsed
< _ps.chars.Length);
3498
_ps.chars[_ps.
charsUsed
] = (char)0;
3507
Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.
charsUsed
- 1);
3521
_ps.decoder.Convert(_ps.bytes, _ps.bytePos, bytesCount, _ps.chars, _ps.
charsUsed
, maxCharsCount, false, out bytesCount, out charsCount, out completed);
3549
_ps.decoder.Convert(_ps.bytes, _ps.bytePos + bytesDecoded, 1, _ps.chars, _ps.
charsUsed
+ charsDecoded, 2, false, out bDec, out chDec, out completed);
3562
Throw(_ps.
charsUsed
, SR.Xml_InvalidCharInThisEncoding);
3603
while (_ps.
charsUsed
- _ps.charPos < 6)
3690
else if (_ps.charPos + 1 == _ps.
charsUsed
)
3856
else if (pos == _ps.
charsUsed
)
3919
if (_ps.
charsUsed
- pos < 4) // minimum "<a/>"
3934
if (_ps.
charsUsed
- pos < 2) // minimum characters expected "--"
3959
if (_ps.
charsUsed
- pos < 6)
4066
else if (pos == _ps.
charsUsed
|| ((_v1Compat || mangoQuirks) && chars[pos] == 0x0))
4094
Debug.Assert(pos == _ps.
charsUsed
&& !_ps.isEof);
4156
if (_ps.
charsUsed
- pos < 2)
4179
if (_ps.
charsUsed
- pos < 6)
4213
if (pos + 1 == _ps.
charsUsed
)
4234
if (pos == _ps.
charsUsed
)
4253
if (_ps.
charsUsed
- _ps.charPos != 0)
4279
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF1);
4303
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOFInElementContent, _stringBuilder.ToString());
4366
else if (pos + 1 < _ps.
charsUsed
)
4428
if (pos + 1 == _ps.
charsUsed
)
4453
Throw(pos, SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4553
while (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
4592
if (pos == _ps.
charsUsed
)
4619
else if (pos == _ps.
charsUsed
&& !_ps.isEof)
4633
else if (pos == _ps.
charsUsed
)
4718
else if (pos + 1 != _ps.
charsUsed
)
4754
if (pos + 1 == _ps.
charsUsed
)
4771
else if (pos == _ps.
charsUsed
)
4777
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4847
else if (pos + 1 >= _ps.
charsUsed
)
5164
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5294
if (pos == _ps.
charsUsed
)
5304
if (pos + 1 == _ps.
charsUsed
)
5315
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
5325
if (_ps.
charsUsed
- _ps.charPos > 0)
5609
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5683
if (_ps.
charsUsed
- pos < 3 && !_ps.isEof)
5696
if (pos == _ps.
charsUsed
)
5706
if (pos + 1 == _ps.
charsUsed
)
5726
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos + offset);
5740
if (_ps.
charsUsed
- _ps.charPos > 0)
5925
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5934
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5952
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos);
5972
if (_ps.charPos + 1 == _ps.
charsUsed
)
6247
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
6250
if (_ps.
charsUsed
- _ps.charPos < 2)
6256
Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.
charsUsed
, _ps.charPos));
6317
if (_ps.
charsUsed
- _ps.charPos < 2)
6321
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF, "PI");
6359
else if (pos + 1 == _ps.
charsUsed
)
6400
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6422
if (pos == _ps.
charsUsed
)
6432
if (pos + 1 == _ps.
charsUsed
)
6443
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6521
if (_ps.
charsUsed
- _ps.charPos < 3)
6566
else if (pos + 2 == _ps.
charsUsed
)
6575
else if (pos + 1 == _ps.
charsUsed
)
6618
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6640
if (pos == _ps.
charsUsed
)
6648
if (pos + 1 == _ps.
charsUsed
)
6659
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6690
while (_ps.
charsUsed
- _ps.charPos < 8)
6772
while (_ps.
charsUsed
- _ps.charPos < 6)
6809
while (_ps.
charsUsed
- _ps.charPos < 6)
6918
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6944
if (pos + 3 >= _ps.
charsUsed
&& !_ps.isEof)
6959
else if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
6969
if (pos + 2 >= _ps.
charsUsed
&& !_ps.isEof)
6987
if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
7028
if (pos == _ps.
charsUsed
)
7038
if (pos + 1 == _ps.
charsUsed
)
7049
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
7058
if (_ps.
charsUsed
- _ps.charPos > 0)
7109
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
7128
if (pos == _ps.
charsUsed
)
7157
if (_ps.
charsUsed
- _ps.charPos == 0)
7261
else if (pos < _ps.
charsUsed
)
7290
if (pos == _ps.
charsUsed
)
7393
Debug.Assert(startPos < _ps.
charsUsed
);
7410
if (_ps.
charsUsed
- pos >= 3)
7427
if (_ps.
charsUsed
- pos >= 4)
7442
else if (pos < _ps.
charsUsed
)
7449
if (_ps.
charsUsed
- pos >= 5)
7466
if (_ps.
charsUsed
- pos >= 3)
7482
if (_ps.
charsUsed
- pos >= 3)
7539
if (pos + 1 >= _ps.
charsUsed
)
7549
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
7588
else if (pos == _ps.
charsUsed
)
8332
else if (pos + 1 < _ps.
charsUsed
)
8349
if (_ps.
charsUsed
- pos < 2)
8362
if (_ps.
charsUsed
- pos < 4)
8372
if (_ps.
charsUsed
- pos < 9)
8454
if (_ps.
charsUsed
- pos < 2)
8493
if (pos == _ps.
charsUsed
)
8669
if (pos == _ps.
charsUsed
)
8679
if (pos + 1 == _ps.
charsUsed
)
8692
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
8795
if (_ps.charPos == _ps.
charsUsed
)
8813
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
8880
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)