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