10 writes to charsUsed
System.Private.Xml (10)
System\Xml\Core\XmlTextReaderImpl.cs (6)
2958
_ps.
charsUsed
= len;
3337
_ps.
charsUsed
= _ps.charPos;
3449
_ps.
charsUsed
= copyCharsCount;
3514
_ps.
charsUsed
+= charsRead;
3561
_ps.
charsUsed
+= charsCount;
8907
_ps.
charsUsed
--;
System\Xml\Core\XmlTextReaderImplAsync.cs (3)
1119
_ps.
charsUsed
= copyCharsCount;
1180
_ps.
charsUsed
+= charsRead;
5277
_ps.
charsUsed
--;
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
70
charsUsed
= 0;
213 references to charsUsed
System.Private.Xml (213)
System\Xml\Core\XmlTextReaderImpl.cs (125)
1509
if (_ps.
charsUsed
- _ps.charPos == 0)
1530
if (_ps.
charsUsed
- _ps.charPos == 0 && !_ps.entity!.IsExternal)
2192
_stringBuilder.Append(_ps.chars, _ps.charPos, _ps.
charsUsed
- _ps.charPos);
2193
_ps.charPos = _ps.
charsUsed
;
2393
return _ps.
charsUsed
;
2405
Debug.Assert(value >= 0 && value <= _ps.
charsUsed
);
2843
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.textReader == null);
2918
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0 && _ps.stream == null);
2948
Debug.Assert(_ps.charPos == 0 && _ps.
charsUsed
== 0);
3289
Debug.Assert(_ps.
charsUsed
>= _ps.charPos, "The current position must be in the valid character range.");
3297
Debug.Assert(_charactersInDocument >= _ps.
charsUsed
- _ps.charPos,
3299
_charactersInDocument -= _ps.
charsUsed
- _ps.charPos;
3306
Debug.Assert(_charactersFromEntities >= _ps.
charsUsed
- _ps.charPos,
3308
_charactersFromEntities -= _ps.
charsUsed
- _ps.charPos;
3364
if (_ps.
charsUsed
== _ps.chars.Length - 1)
3407
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3416
if (charsLen - _ps.
charsUsed
<= charsLen / 2)
3440
int copyCharsCount = _ps.
charsUsed
- _ps.charPos;
3479
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
3513
charsRead = _ps.textReader.Read(_ps.chars, _ps.
charsUsed
, _ps.chars.Length - _ps.
charsUsed
- 1);
3525
Debug.Assert(_ps.
charsUsed
< _ps.chars.Length);
3529
_ps.chars[_ps.
charsUsed
] = (char)0;
3538
Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.
charsUsed
- 1);
3552
_ps.decoder.Convert(_ps.bytes, _ps.bytePos, bytesCount, _ps.chars, _ps.
charsUsed
, maxCharsCount, false, out bytesCount, out charsCount, out completed);
3580
_ps.decoder.Convert(_ps.bytes, _ps.bytePos + bytesDecoded, 1, _ps.chars, _ps.
charsUsed
+ charsDecoded, 2, false, out bDec, out chDec, out completed);
3593
Throw(_ps.
charsUsed
, SR.Xml_InvalidCharInThisEncoding);
3634
while (_ps.
charsUsed
- _ps.charPos < 6)
3721
else if (_ps.charPos + 1 == _ps.
charsUsed
)
3887
else if (pos == _ps.
charsUsed
)
3950
if (_ps.
charsUsed
- pos < 4) // minimum "<a/>"
3965
if (_ps.
charsUsed
- pos < 2) // minimum characters expected "--"
3990
if (_ps.
charsUsed
- pos < 6)
4097
else if (pos == _ps.
charsUsed
|| ((_v1Compat || mangoQuirks) && chars[pos] == 0x0))
4125
Debug.Assert(pos == _ps.
charsUsed
&& !_ps.isEof);
4187
if (_ps.
charsUsed
- pos < 2)
4210
if (_ps.
charsUsed
- pos < 6)
4244
if (pos + 1 == _ps.
charsUsed
)
4265
if (pos == _ps.
charsUsed
)
4284
if (_ps.
charsUsed
- _ps.charPos != 0)
4310
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF1);
4334
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOFInElementContent, _stringBuilder.ToString());
4397
else if (pos + 1 < _ps.
charsUsed
)
4459
if (pos + 1 == _ps.
charsUsed
)
4484
Throw(pos, SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4584
while (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
4623
if (pos == _ps.
charsUsed
)
4650
else if (pos == _ps.
charsUsed
&& !_ps.isEof)
4664
else if (pos == _ps.
charsUsed
)
4749
else if (pos + 1 != _ps.
charsUsed
)
4785
if (pos + 1 == _ps.
charsUsed
)
4802
else if (pos == _ps.
charsUsed
)
4808
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
4878
else if (pos + 1 >= _ps.
charsUsed
)
5188
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5318
if (pos == _ps.
charsUsed
)
5328
if (pos + 1 == _ps.
charsUsed
)
5339
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
5349
if (_ps.
charsUsed
- _ps.charPos > 0)
5633
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
5707
if (_ps.
charsUsed
- pos < 3 && !_ps.isEof)
5720
if (pos == _ps.
charsUsed
)
5730
if (pos + 1 == _ps.
charsUsed
)
5750
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos + offset);
5764
if (_ps.
charsUsed
- _ps.charPos > 0)
5949
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5958
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || ZeroEndingStream(_ps.charPos))
5976
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos);
5996
if (_ps.charPos + 1 == _ps.
charsUsed
)
6271
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
6274
if (_ps.
charsUsed
- _ps.charPos < 2)
6280
Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.
charsUsed
, _ps.charPos));
6341
if (_ps.
charsUsed
- _ps.charPos < 2)
6345
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF, "PI");
6383
else if (pos + 1 == _ps.
charsUsed
)
6424
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6446
if (pos == _ps.
charsUsed
)
6456
if (pos + 1 == _ps.
charsUsed
)
6467
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6545
if (_ps.
charsUsed
- _ps.charPos < 3)
6590
else if (pos + 2 == _ps.
charsUsed
)
6599
else if (pos + 1 == _ps.
charsUsed
)
6642
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6664
if (pos == _ps.
charsUsed
)
6672
if (pos + 1 == _ps.
charsUsed
)
6683
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
6714
while (_ps.
charsUsed
- _ps.charPos < 8)
6796
while (_ps.
charsUsed
- _ps.charPos < 6)
6833
while (_ps.
charsUsed
- _ps.charPos < 6)
6942
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
6968
if (pos + 3 >= _ps.
charsUsed
&& !_ps.isEof)
6983
else if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
6993
if (pos + 2 >= _ps.
charsUsed
&& !_ps.isEof)
7011
if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
7052
if (pos == _ps.
charsUsed
)
7062
if (pos + 1 == _ps.
charsUsed
)
7073
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
7082
if (_ps.
charsUsed
- _ps.charPos > 0)
7133
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
7152
if (pos == _ps.
charsUsed
)
7181
if (_ps.
charsUsed
- _ps.charPos == 0)
7285
else if (pos < _ps.
charsUsed
)
7314
if (pos == _ps.
charsUsed
)
7417
Debug.Assert(startPos < _ps.
charsUsed
);
7434
if (_ps.
charsUsed
- pos >= 3)
7451
if (_ps.
charsUsed
- pos >= 4)
7466
else if (pos < _ps.
charsUsed
)
7473
if (_ps.
charsUsed
- pos >= 5)
7490
if (_ps.
charsUsed
- pos >= 3)
7506
if (_ps.
charsUsed
- pos >= 3)
7563
if (pos + 1 >= _ps.
charsUsed
)
7573
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
7612
else if (pos == _ps.
charsUsed
)
8357
else if (pos + 1 < _ps.
charsUsed
)
8374
if (_ps.
charsUsed
- pos < 2)
8387
if (_ps.
charsUsed
- pos < 4)
8397
if (_ps.
charsUsed
- pos < 9)
8479
if (_ps.
charsUsed
- pos < 2)
8518
if (pos == _ps.
charsUsed
)
8694
if (pos == _ps.
charsUsed
)
8704
if (pos + 1 == _ps.
charsUsed
)
8717
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
8820
if (_ps.charPos == _ps.
charsUsed
)
8838
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
8905
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)
1077
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
1086
if (charsLen - _ps.
charsUsed
<= charsLen / 2)
1110
int copyCharsCount = _ps.
charsUsed
- _ps.charPos;
1147
charsRead = _ps.chars.Length - _ps.
charsUsed
- 1;
1179
charsRead = await _ps.textReader.ReadAsync(_ps.chars.AsMemory(_ps.
charsUsed
, _ps.chars.Length - _ps.
charsUsed
- 1)).ConfigureAwait(false);
1191
Debug.Assert(_ps.
charsUsed
< _ps.chars.Length);
1194
_ps.chars[_ps.
charsUsed
] = (char)0;
1201
while (_ps.
charsUsed
- _ps.charPos < 6)
1287
else if (_ps.charPos + 1 == _ps.
charsUsed
)
1448
else if (pos == _ps.
charsUsed
)
1511
if (_ps.
charsUsed
- pos < 4) // minimum "<a/>"
1522
if (_ps.
charsUsed
- pos < 2) // minimum characters expected "--"
1543
if (_ps.
charsUsed
- pos < 6)
1610
else if (pos == _ps.
charsUsed
|| (_v1Compat && chars[pos] == 0x0))
1627
Debug.Assert(pos == _ps.
charsUsed
&& !_ps.isEof);
1778
if (_ps.
charsUsed
- pos < 2)
1797
if (_ps.
charsUsed
- pos < 6)
1829
if (pos + 1 == _ps.
charsUsed
)
1845
if (pos == _ps.
charsUsed
)
1863
if (_ps.
charsUsed
- _ps.charPos != 0)
1943
else if (pos + 1 < _ps.
charsUsed
)
2045
if (pos + 1 == _ps.
charsUsed
)
2065
Throw(pos, SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
2097
if (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
2119
while (_ps.
charsUsed
- _ps.charPos < prefLen + locLen + 1)
2220
if (pos == _ps.
charsUsed
)
2255
else if (pos == _ps.
charsUsed
&& !_ps.isEof)
2269
else if (pos == _ps.
charsUsed
)
2364
else if (pos + 1 != _ps.
charsUsed
)
2400
if (pos + 1 == _ps.
charsUsed
)
2417
else if (pos == _ps.
charsUsed
)
2423
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
2499
else if (pos + 1 >= _ps.
charsUsed
)
2687
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
2822
if (pos == _ps.
charsUsed
)
2832
if (pos + 1 == _ps.
charsUsed
)
2843
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
2853
if (_ps.
charsUsed
- _ps.charPos > 0)
3321
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
3348
if (_ps.
charsUsed
- pos < 3 && !_ps.isEof)
3363
if (pos == _ps.
charsUsed
)
3455
if (pos + 1 == _ps.
charsUsed
)
3482
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos + offset);
3499
if (_ps.
charsUsed
- _ps.charPos > 0)
3714
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || await ZeroEndingStreamAsync(_ps.charPos).ConfigureAwait(false))
3723
if (_ps.chars[_ps.charPos] == '<' || _ps.
charsUsed
- _ps.charPos == 0 || await ZeroEndingStreamAsync(_ps.charPos).ConfigureAwait(false))
3741
ThrowInvalidChar(_ps.chars, _ps.
charsUsed
, _ps.charPos);
3761
if (_ps.charPos + 1 == _ps.
charsUsed
)
3964
Debug.Assert(_ps.charPos < _ps.
charsUsed
);
3967
if (_ps.
charsUsed
- _ps.charPos < 2)
3973
Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.
charsUsed
, _ps.charPos));
4053
if (_ps.
charsUsed
- _ps.charPos < 2)
4057
Throw(_ps.
charsUsed
, SR.Xml_UnexpectedEOF, "PI");
4096
else if (pos + 1 == _ps.
charsUsed
)
4137
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4159
if (pos == _ps.
charsUsed
)
4169
if (pos + 1 == _ps.
charsUsed
)
4180
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4277
if (_ps.
charsUsed
- _ps.charPos < 3)
4322
else if (pos + 2 == _ps.
charsUsed
)
4331
else if (pos + 1 == _ps.
charsUsed
)
4374
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4396
if (pos == _ps.
charsUsed
)
4404
if (pos + 1 == _ps.
charsUsed
)
4415
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4447
while (_ps.
charsUsed
- _ps.charPos < 8)
4530
while (_ps.
charsUsed
- _ps.charPos < 6)
4567
while (_ps.
charsUsed
- _ps.charPos < 6)
4674
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4700
if (pos + 3 >= _ps.
charsUsed
&& !_ps.isEof)
4715
else if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
4725
if (pos + 2 >= _ps.
charsUsed
&& !_ps.isEof)
4743
if (pos + 1 >= _ps.
charsUsed
&& !_ps.isEof)
4784
if (pos == _ps.
charsUsed
)
4794
if (pos + 1 == _ps.
charsUsed
)
4805
ThrowInvalidChar(chars, _ps.
charsUsed
, pos);
4814
if (_ps.
charsUsed
- _ps.charPos > 0)
4864
else if (pos + 1 < _ps.
charsUsed
|| _ps.isEof)
4883
if (pos == _ps.
charsUsed
)
4912
if (_ps.
charsUsed
- _ps.charPos == 0)
5024
if (pos + 1 >= _ps.
charsUsed
)
5037
Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.
charsUsed
, pos));
5076
else if (pos == _ps.
charsUsed
)
5275
if (_v1Compat && pos == _ps.
charsUsed
- 1 && _ps.chars[pos] == (char)0 && await ReadDataAsync().ConfigureAwait(false) == 0 && _ps.isStreamEof)