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