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