10 writes to charsUsed
System.Xml (10)
System\Xml\Core\XmlTextReaderImpl.cs (6)
2723ps.charsUsed = len; 3062ps.charsUsed = ps.charPos; 3127ps.charsUsed = copyCharsCount; 3177ps.charsUsed += charsRead; 3216ps.charsUsed += charsCount; 7923ps.charsUsed--;
System\Xml\Core\XmlTextReaderImplAsync.cs (3)
1037ps.charsUsed = copyCharsCount; 1087ps.charsUsed += charsRead; 4878ps.charsUsed--;
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
81charsUsed = 0;
213 references to charsUsed
System.Xml (213)
System\Xml\Core\XmlTextReaderImpl.cs (125)
1442if ( ps.charsUsed - ps.charPos == 0 ) { // entity value == "" 1460if ( ps.charsUsed - ps.charPos == 0 && !ps.entity.IsExternal ) { // empty internal entity value 2048stringBuilder.Append( ps.chars, ps.charPos, ps.charsUsed - ps.charPos ); 2049ps.charPos = ps.charsUsed; 2226return ps.charsUsed; 2235Debug.Assert( value >= 0 && value <= ps.charsUsed ); 2602Debug.Assert( ps.charPos == 0 && ps.charsUsed == 0 && ps.textReader == null ); 2683Debug.Assert( ps.charPos == 0 && ps.charsUsed == 0 && ps.stream == null ); 2713Debug.Assert( ps.charPos == 0 && ps.charsUsed == 0 ); 3039Debug.Assert(ps.charsUsed >= ps.charPos, "The current position must be in the valid character range."); 3046Debug.Assert(charactersInDocument >= ps.charsUsed - ps.charPos, 3048charactersInDocument -= ps.charsUsed - ps.charPos; 3052Debug.Assert(charactersFromEntities >= ps.charsUsed - ps.charPos, 3054charactersFromEntities -= ps.charsUsed - ps.charPos; 3084if ( ps.charsUsed == ps.chars.Length - 1 ) { 3106charsRead = ps.chars.Length - ps.charsUsed - 1; 3113if ( charsLen - ps.charsUsed <= charsLen/2 ) { 3120int copyCharsCount = ps.charsUsed - ps.charPos; 3150charsRead = ps.chars.Length - ps.charsUsed - 1; 3176charsRead = ps.textReader.Read( ps.chars, ps.charsUsed, ps.chars.Length - ps.charsUsed - 1 ); 3186Debug.Assert ( ps.charsUsed < ps.chars.Length ); 3189ps.chars[ ps.charsUsed ] = (char)0; 3196Debug.Assert( maxCharsCount <= ps.chars.Length - ps.charsUsed - 1 ); 3208ps.decoder.Convert( ps.bytes, ps.bytePos, bytesCount, ps.chars, ps.charsUsed, maxCharsCount, false, out bytesCount, out charsCount, out completed ); 3229ps.decoder.Convert( ps.bytes, ps.bytePos + bytesDecoded, 1, ps.chars, ps.charsUsed + charsDecoded, 1, false, out bDec, out chDec, out completed ); 3239Throw( ps.charsUsed, Res.Xml_InvalidCharInThisEncoding ); 3273while ( ps.charsUsed - ps.charPos < 6 ) { // minimum "<?xml " 3349else if ( ps.charPos + 1 == ps.charsUsed ) { 3503else if ( pos == ps.charsUsed ) { 3564if ( ps.charsUsed - pos < 4 ) // minimum "<a/>" 3577if ( ps.charsUsed - pos < 2 ) // minimum characters expected "--" 3596if ( ps.charsUsed - pos < 6 ) { 3687else if ( pos == ps.charsUsed || ( ( v1Compat || mangoQuirks ) && chars[pos] == 0x0 ) ) { 3708Debug.Assert( pos == ps.charsUsed && !ps.isEof ); 3769if ( ps.charsUsed - pos < 2 ) 3787if ( ps.charsUsed - pos < 6 ) { 3816if ( pos+1 == ps.charsUsed ) { 3834if ( pos == ps.charsUsed ) { 3849if ( ps.charsUsed - ps.charPos != 0 ) { 3873Throw( ps.charsUsed, Res.Xml_UnexpectedEOF1 ); 3891Throw ( ps.charsUsed, Res.Xml_UnexpectedEOFInElementContent, stringBuilder.ToString() ); 3964else if ( pos + 1 < ps.charsUsed ) { 4023if ( pos+1 == ps.charsUsed ) { 4043Throw( pos, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( chars, ps.charsUsed, pos ) ); 4131while ( ps.charsUsed - ps.charPos < prefLen + locLen + 1 ) { 4162if ( pos == ps.charsUsed ) { 4194else if (pos == ps.charsUsed && !ps.isEof) { 4206else if ( pos == ps.charsUsed ) { 4284else if ( pos+1 != ps.charsUsed ) { 4326if ( pos+1 == ps.charsUsed ) { 4340else if ( pos == ps.charsUsed ) { 4344Throw( pos, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs( chars, ps.charsUsed, pos ) ); 4427else if ( pos + 1 >= ps.charsUsed ) { 4704else if ( pos+1 < ps.charsUsed || ps.isEof ) { 4827if ( pos == ps.charsUsed ) { 4834if ( pos + 1 == ps.charsUsed ) { 4843ThrowInvalidChar( chars, ps.charsUsed, pos ); 4852if ( ps.charsUsed - ps.charPos > 0 ) { 5105else if ( pos + 1 < ps.charsUsed || ps.isEof ) { 5170if ( ps.charsUsed - pos < 3 && !ps.isEof ) { 5181if ( pos == ps.charsUsed ) { 5188if ( pos + 1 == ps.charsUsed ) { 5205ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos + offset ); 5217if ( ps.charsUsed - ps.charPos > 0 ) { 5380if ( ps.chars[ps.charPos] == '<' || ps.charsUsed - ps.charPos == 0 || ZeroEndingStream( ps.charPos ) ) { 5387if ( ps.chars[ps.charPos] == '<' || ps.charsUsed - ps.charPos == 0 || ZeroEndingStream( ps.charPos ) ) { 5401ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos ); 5419if ( ps.charPos + 1 == ps.charsUsed ) { 5670Debug.Assert( ps.charPos < ps.charsUsed ); 5672if ( ps.charsUsed - ps.charPos < 2 ) { 5676Throw( Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ps.chars, ps.charsUsed, ps.charPos ) ); 5724if ( ps.charsUsed - ps.charPos < 2 ) { 5726Throw( ps.charsUsed, Res.Xml_UnexpectedEOF, "PI" ); 5768else if ( pos+1 == ps.charsUsed ) { 5801else if ( pos+1 < ps.charsUsed || ps.isEof ) { 5820if ( pos == ps.charsUsed ) { 5827if ( pos + 1 == ps.charsUsed ) { 5836ThrowInvalidChar( chars, ps.charsUsed, pos ); 5900if ( ps.charsUsed - ps.charPos < 3 ) { 5946else if ( pos+2 == ps.charsUsed ) { 5953else if ( pos+1 == ps.charsUsed ) { 5987else if ( pos+1 < ps.charsUsed || ps.isEof ) { 6006if ( pos == ps.charsUsed ) { 6012if ( pos + 1 == ps.charsUsed ) { 6021ThrowInvalidChar( chars, ps.charsUsed, pos ); 6048while ( ps.charsUsed - ps.charPos < 8 ) { 6120while ( ps.charsUsed - ps.charPos < 6 ) { 6151while ( ps.charsUsed - ps.charPos < 6 ) { 6249else if ( pos+1 < ps.charsUsed || ps.isEof ) { 6270if ( pos + 3 >= ps.charsUsed && !ps.isEof ) { 6282else if ( pos + 1 >= ps.charsUsed && !ps.isEof ) { 6290if ( pos + 2 >= ps.charsUsed && !ps.isEof ) { 6305if (pos + 1 >= ps.charsUsed && !ps.isEof) { 6340if ( pos == ps.charsUsed ) { 6347if ( pos + 1 == ps.charsUsed ) { 6356ThrowInvalidChar( chars, ps.charsUsed, pos ); 6364if ( ps.charsUsed - ps.charPos > 0 ) { 6404else if ( pos+1 < ps.charsUsed || ps.isEof ) { 6420if ( pos == ps.charsUsed ) { 6448if ( ps.charsUsed - ps.charPos == 0 ) { 6539else if ( pos < ps.charsUsed ) { 6561if ( pos == ps.charsUsed ) { 6650Debug.Assert( startPos < ps.charsUsed ); 6664if ( ps.charsUsed - pos >= 3 ) { 6677if ( ps.charsUsed - pos >= 4 ) { 6689else if ( pos < ps.charsUsed ) { 6695if ( ps.charsUsed - pos >= 5 ) { 6709if ( ps.charsUsed - pos >= 3 ) { 6722if ( ps.charsUsed - pos >= 3 ) { 6782if ( pos + 1 >= ps.charsUsed ) { 6789Throw( pos, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs( chars, ps.charsUsed, pos ) ); 6833else if ( pos == ps.charsUsed 7469else if ( pos+1 < ps.charsUsed ) { 7483if ( ps.charsUsed - pos < 2 ) { 7494if ( ps.charsUsed - pos < 4 ) { 7502if ( ps.charsUsed - pos < 9 ) { 7576if ( ps.charsUsed - pos < 2 ) { 7610if ( pos == ps.charsUsed ) { 7765if ( pos == ps.charsUsed ) { 7772if ( pos + 1 == ps.charsUsed ) { 7781ThrowInvalidChar( chars, ps.charsUsed, pos ); 7863if ( ps.charPos == ps.charsUsed ) { 7874Debug.Assert( ps.charPos < ps.charsUsed ); 7922if ( v1Compat && pos == ps.charsUsed - 1 && ps.chars[pos] == (char)0 && ReadData() == 0 && ps.isStreamEof ) {
System\Xml\Core\XmlTextReaderImplAsync.cs (88)
828Debug.Assert( ps.charPos == 0 && ps.charsUsed == 0 && ps.textReader == null ); 906Debug.Assert( ps.charPos == 0 && ps.charsUsed == 0 && ps.stream == null ); 994if ( ps.charsUsed == ps.chars.Length - 1 ) { 1016charsRead = ps.chars.Length - ps.charsUsed - 1; 1023if ( charsLen - ps.charsUsed <= charsLen/2 ) { 1030int copyCharsCount = ps.charsUsed - ps.charPos; 1060charsRead = ps.chars.Length - ps.charsUsed - 1; 1086charsRead = await ps.textReader.ReadAsync( ps.chars, ps.charsUsed, ps.chars.Length - ps.charsUsed - 1 ).ConfigureAwait(false); 1096Debug.Assert ( ps.charsUsed < ps.chars.Length ); 1099ps.chars[ ps.charsUsed ] = (char)0; 1105while ( ps.charsUsed - ps.charPos < 6 ) { // minimum "<?xml " 1181else if ( ps.charPos + 1 == ps.charsUsed ) { 1336else if ( pos == ps.charsUsed ) { 1388if (ps.charsUsed - pos < 4) // minimum "<a/>" 1398if (ps.charsUsed - pos < 2) // minimum characters expected "--" 1414if (ps.charsUsed - pos < 6) { 1468else if (pos == ps.charsUsed || (v1Compat && chars[pos] == 0x0)) { 1481Debug.Assert(pos == ps.charsUsed && !ps.isEof); 1610if (ps.charsUsed - pos < 2) 1625if (ps.charsUsed - pos < 6) { 1652if (pos + 1 == ps.charsUsed) { 1666if (pos == ps.charsUsed) { 1680if (ps.charsUsed - ps.charPos != 0) { 1773else if (pos + 1 < ps.charsUsed) { 1867if (pos + 1 == ps.charsUsed) { 1883Throw(pos, Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(chars, ps.charsUsed, pos)); 1911if (ps.charsUsed - ps.charPos < prefLen + locLen + 1) { 1930while (ps.charsUsed - ps.charPos < prefLen + locLen + 1) { 2018if (pos == ps.charsUsed) { 2057else if (pos == ps.charsUsed && !ps.isEof) { 2069else if (pos == ps.charsUsed) { 2159else if ( pos+1 != ps.charsUsed ) { 2201if ( pos+1 == ps.charsUsed ) { 2215else if ( pos == ps.charsUsed ) { 2219Throw( pos, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs( chars, ps.charsUsed, pos ) ); 2308else if ( pos + 1 >= ps.charsUsed ) { 2486else if ( pos+1 < ps.charsUsed || ps.isEof ) { 2614if ( pos == ps.charsUsed ) { 2621if ( pos + 1 == ps.charsUsed ) { 2630ThrowInvalidChar( chars, ps.charsUsed, pos ); 2639if ( ps.charsUsed - ps.charPos > 0 ) { 3077else if (pos + 1 < ps.charsUsed || ps.isEof) { 3101if (ps.charsUsed - pos < 3 && !ps.isEof) { 3114if (pos == ps.charsUsed) { 3195if (pos + 1 == ps.charsUsed) { 3218ThrowInvalidChar(ps.chars, ps.charsUsed, ps.charPos + offset); 3233if (ps.charsUsed - ps.charPos > 0) { 3430if ( ps.chars[ps.charPos] == '<' || ps.charsUsed - ps.charPos == 0 || await ZeroEndingStreamAsync( ps.charPos ).ConfigureAwait(false) ) { 3437if ( ps.chars[ps.charPos] == '<' || ps.charsUsed - ps.charPos == 0 || await ZeroEndingStreamAsync( ps.charPos ).ConfigureAwait(false) ) { 3451ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos ); 3471if ( ps.charPos + 1 == ps.charsUsed ) { 3661Debug.Assert( ps.charPos < ps.charsUsed ); 3663if ( ps.charsUsed - ps.charPos < 2 ) { 3667Throw( Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ps.chars, ps.charsUsed, ps.charPos ) ); 3740if ( ps.charsUsed - ps.charPos < 2 ) { 3742Throw( ps.charsUsed, Res.Xml_UnexpectedEOF, "PI" ); 3787else if ( pos+1 == ps.charsUsed ) { 3820else if ( pos+1 < ps.charsUsed || ps.isEof ) { 3839if ( pos == ps.charsUsed ) { 3846if ( pos + 1 == ps.charsUsed ) { 3855ThrowInvalidChar( chars, ps.charsUsed, pos ); 3948if ( ps.charsUsed - ps.charPos < 3 ) { 3996else if ( pos+2 == ps.charsUsed ) { 4003else if ( pos+1 == ps.charsUsed ) { 4037else if ( pos+1 < ps.charsUsed || ps.isEof ) { 4056if ( pos == ps.charsUsed ) { 4062if ( pos + 1 == ps.charsUsed ) { 4071ThrowInvalidChar( chars, ps.charsUsed, pos ); 4100while ( ps.charsUsed - ps.charPos < 8 ) { 4177while ( ps.charsUsed - ps.charPos < 6 ) { 4208while ( ps.charsUsed - ps.charPos < 6 ) { 4306else if ( pos+1 < ps.charsUsed || ps.isEof ) { 4327if ( pos + 3 >= ps.charsUsed && !ps.isEof ) { 4339else if ( pos + 1 >= ps.charsUsed && !ps.isEof ) { 4347if ( pos + 2 >= ps.charsUsed && !ps.isEof ) { 4362if (pos + 1 >= ps.charsUsed && !ps.isEof) { 4397if ( pos == ps.charsUsed ) { 4404if ( pos + 1 == ps.charsUsed ) { 4413ThrowInvalidChar( chars, ps.charsUsed, pos ); 4421if ( ps.charsUsed - ps.charPos > 0 ) { 4461else if ( pos+1 < ps.charsUsed || ps.isEof ) { 4477if ( pos == ps.charsUsed ) { 4505if ( ps.charsUsed - ps.charPos == 0 ) { 4618if (pos + 1 >= ps.charsUsed) { 4622Throw(pos, Res.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, ps.charsUsed, pos)); 4676else if ( pos == ps.charsUsed 4877if ( v1Compat && pos == ps.charsUsed - 1 && ps.chars[pos] == (char)0 && await ReadDataAsync().ConfigureAwait(false) == 0 && ps.isStreamEof ) {