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; 8875_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)
70charsUsed = 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) 5157else if (pos + 1 < _ps.charsUsed || _ps.isEof) 5287if (pos == _ps.charsUsed) 5297if (pos + 1 == _ps.charsUsed) 5308ThrowInvalidChar(chars, _ps.charsUsed, pos); 5318if (_ps.charsUsed - _ps.charPos > 0) 5602else if (pos + 1 < _ps.charsUsed || _ps.isEof) 5676if (_ps.charsUsed - pos < 3 && !_ps.isEof) 5689if (pos == _ps.charsUsed) 5699if (pos + 1 == _ps.charsUsed) 5719ThrowInvalidChar(_ps.chars, _ps.charsUsed, _ps.charPos + offset); 5733if (_ps.charsUsed - _ps.charPos > 0) 5918if (_ps.chars[_ps.charPos] == '<' || _ps.charsUsed - _ps.charPos == 0 || ZeroEndingStream(_ps.charPos)) 5927if (_ps.chars[_ps.charPos] == '<' || _ps.charsUsed - _ps.charPos == 0 || ZeroEndingStream(_ps.charPos)) 5945ThrowInvalidChar(_ps.chars, _ps.charsUsed, _ps.charPos); 5965if (_ps.charPos + 1 == _ps.charsUsed) 6240Debug.Assert(_ps.charPos < _ps.charsUsed); 6243if (_ps.charsUsed - _ps.charPos < 2) 6249Throw(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(_ps.chars, _ps.charsUsed, _ps.charPos)); 6310if (_ps.charsUsed - _ps.charPos < 2) 6314Throw(_ps.charsUsed, SR.Xml_UnexpectedEOF, "PI"); 6352else if (pos + 1 == _ps.charsUsed) 6393else if (pos + 1 < _ps.charsUsed || _ps.isEof) 6415if (pos == _ps.charsUsed) 6425if (pos + 1 == _ps.charsUsed) 6436ThrowInvalidChar(chars, _ps.charsUsed, pos); 6514if (_ps.charsUsed - _ps.charPos < 3) 6559else if (pos + 2 == _ps.charsUsed) 6568else if (pos + 1 == _ps.charsUsed) 6611else if (pos + 1 < _ps.charsUsed || _ps.isEof) 6633if (pos == _ps.charsUsed) 6641if (pos + 1 == _ps.charsUsed) 6652ThrowInvalidChar(chars, _ps.charsUsed, pos); 6683while (_ps.charsUsed - _ps.charPos < 8) 6765while (_ps.charsUsed - _ps.charPos < 6) 6802while (_ps.charsUsed - _ps.charPos < 6) 6911else if (pos + 1 < _ps.charsUsed || _ps.isEof) 6937if (pos + 3 >= _ps.charsUsed && !_ps.isEof) 6952else if (pos + 1 >= _ps.charsUsed && !_ps.isEof) 6962if (pos + 2 >= _ps.charsUsed && !_ps.isEof) 6980if (pos + 1 >= _ps.charsUsed && !_ps.isEof) 7021if (pos == _ps.charsUsed) 7031if (pos + 1 == _ps.charsUsed) 7042ThrowInvalidChar(chars, _ps.charsUsed, pos); 7051if (_ps.charsUsed - _ps.charPos > 0) 7102else if (pos + 1 < _ps.charsUsed || _ps.isEof) 7121if (pos == _ps.charsUsed) 7150if (_ps.charsUsed - _ps.charPos == 0) 7254else if (pos < _ps.charsUsed) 7283if (pos == _ps.charsUsed) 7386Debug.Assert(startPos < _ps.charsUsed); 7403if (_ps.charsUsed - pos >= 3) 7420if (_ps.charsUsed - pos >= 4) 7435else if (pos < _ps.charsUsed) 7442if (_ps.charsUsed - pos >= 5) 7459if (_ps.charsUsed - pos >= 3) 7475if (_ps.charsUsed - pos >= 3) 7532if (pos + 1 >= _ps.charsUsed) 7542Throw(pos, SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.charsUsed, pos)); 7581else if (pos == _ps.charsUsed) 8325else if (pos + 1 < _ps.charsUsed) 8342if (_ps.charsUsed - pos < 2) 8355if (_ps.charsUsed - pos < 4) 8365if (_ps.charsUsed - pos < 9) 8447if (_ps.charsUsed - pos < 2) 8486if (pos == _ps.charsUsed) 8662if (pos == _ps.charsUsed) 8672if (pos + 1 == _ps.charsUsed) 8685ThrowInvalidChar(chars, _ps.charsUsed, pos); 8788if (_ps.charPos == _ps.charsUsed) 8806Debug.Assert(_ps.charPos < _ps.charsUsed); 8873if (_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)