11 writes to chars
System.Xml (11)
System\Xml\Core\XmlTextReaderImpl.cs (6)
2636ps.chars = new char[ bufferSize + 1 ]; 2695ps.chars = new char[XmlReader.AsyncBufferSize + 1]; 2698ps.chars = new char[XmlReader.DefaultBufferSize + 1]; 2721ps.chars = new char[ len + 1 ]; 3092ps.chars = newChars; 3132ps.chars = newChars;
System\Xml\Core\XmlTextReaderImplAsync.cs (4)
860ps.chars = new char[ bufferSize + 1 ]; 925ps.chars = new char[bufferSize + 1]; 1002ps.chars = newChars; 1042ps.chars = newChars;
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
79chars = null;
313 references to chars
System.Xml (313)
System\Xml\Core\XmlTextReaderImpl.cs (184)
1787BlockCopyChars( ps.chars, startPos, buffer, ( index + readCount ), copyCount ); 1807curNode.SetValue( ps.chars, startPos, endPos - startPos ); 2037stringBuilder.Append( ps.chars, incReadLeftStartPos, incReadLeftEndPos - incReadLeftStartPos ); 2048stringBuilder.Append( ps.chars, ps.charPos, ps.charsUsed - ps.charPos ); 2220return ps.chars; 2635if ( ps.chars == null || ps.chars.Length < bufferSize + 1 ) { 2690if ( ps.chars == null ) { 2722str.CopyTo( 0, ps.chars, 0, str.Length ); 2724ps.chars[len] = (char)0; 3060ps.bytePos += ps.encoding.GetByteCount( ps.chars, 0, ps.charPos ); 3084if ( ps.charsUsed == ps.chars.Length - 1 ) { 3090char[] newChars = new char[ ps.chars.Length * 2 ]; 3091BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length ); 3106charsRead = ps.chars.Length - ps.charsUsed - 1; 3112int charsLen = ps.chars.Length; 3124BlockCopyChars( ps.chars, ps.charPos, ps.chars, 0, copyCharsCount ); 3130char[] newChars = new char[ ps.chars.Length * 2 ]; 3131BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length ); 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 ); 3268BlockCopyChars( ps.chars, sourcePos, ps.chars, destPos, count ); 3279if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 5, XmlDeclarationBegining ) || 3280xmlCharType.IsNameSingleChar( ps.chars[ps.charPos + 5] ) 3307if ( ps.chars[ps.charPos] == '?' ) { 3310if ( ps.chars[ps.charPos + 1] == '>' ) { 3365switch ( ps.chars[ps.charPos] ) { 3367if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "version" ) && xmlDeclState == 0 ) { 3375if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "encoding" ) && 3385if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "standalone" ) && 3401sb.Append( ps.chars, ps.charPos, nameEndPos - ps.charPos ); 3405if ( ps.chars[ps.charPos] != '=' ) { 3407if ( ps.chars[ps.charPos] != '=' ) { 3414char quoteChar = ps.chars[ps.charPos]; 3417quoteChar = ps.chars[ps.charPos]; 3433chars = ps.chars; 3446if ( ps.chars[pos] == quoteChar ) { 3458if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "1.0" ) ) { 3461attr.SetValue( ps.chars, ps.charPos, pos - ps.charPos ); 3466string badVersion = new string( ps.chars, ps.charPos, pos - ps.charPos ); 3471string encName = new string( ps.chars, ps.charPos, pos - ps.charPos ); 3479if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "yes" ) ) { 3482else if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "no" ) ) { 3490attr.SetValue( ps.chars, ps.charPos, pos - ps.charPos ); 3559char[] chars = ps.chars; 3680chars = ps.chars; 3745chars = ps.chars; 3754char[] chars = ps.chars; 3898char[] chars = ps.chars; 3970chars = ps.chars; 4029chars = ps.chars; 4138char[] chars = ps.chars; 4160chars = ps.chars; 4246args[3] = new string( ps.chars, ps.charPos, endPos - ps.charPos ); 4258char[] chars = ps.chars; 4424chars = ps.chars; 4429chars = ps.chars; 4495chars = ps.chars; 4521chars = ps.chars; 4653char[] chars = ps.chars; 4823chars = ps.chars; 4853if ( ps.chars[ps.charPos] != (char)0xD ) { 4886chars = ps.chars; 4951curNode.SetValueNode( nodeType, ps.chars, startPos, endPos - startPos ); 4960stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 4965stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 4987curNode.SetValueNode( XmlNodeType.Text, ps.chars, startPos, endPos - startPos ); 4995stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5000stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5053char[] chars = ps.chars; 5158if ( !xmlCharType.IsWhiteSpace(ps.chars[pos-1]) ) { 5166chars = ps.chars; 5200chars = ps.chars; 5205ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos + offset ); 5218if ( ps.chars[ps.charPos] != (char)0xD && ps.chars[ps.charPos] != ']') { 5242chars = ps.chars; 5272stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5274stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 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 ) ) { 5397if ( xmlCharType.IsCharData( ps.chars[ps.charPos] ) ) { 5401ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos ); 5408Debug.Assert( ps.chars[ps.charPos] == '&' ); 5417Debug.Assert( ps.chars[ps.charPos] == '&' ); 5426if ( ps.chars[ps.charPos+1] == '#' ) { 5463if ( ps.chars[endPos] != ';' ) { 5468string entityName = nameTable.Add( ps.chars, ps.charPos, endPos - ps.charPos ); 5652string target = nameTable.Add( ps.chars, ps.charPos, nameEndPos - ps.charPos ); 5669char ch = ps.chars[ps.charPos]; 5675if ( ch != '?' || ps.chars[ps.charPos+1] != '>' ) { 5676Throw( Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ps.chars, ps.charsUsed, ps.charPos ) ); 5688curNode.SetValue( ps.chars, startPos, endPos - startPos ); 5692piInDtdStringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5710sb.Append( ps.chars, startPos, endPos - startPos ); 5712sb.Append( ps.chars, startPos, endPos - startPos ); 5731char[] chars = ps.chars; 5882curNode.SetValueNode( type, ps.chars, startPos, endPos - startPos ); 5886stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5888stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 5908char[] chars = ps.chars; 6053if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 7, "DOCTYPE" ) ) { 6056if ( !xmlCharType.IsWhiteSpace( ps.chars[ps.charPos + 7] ) ) { 6118if ( ps.chars[ps.charPos] == 'P' ) { 6126if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 6, "PUBLIC" ) ) { 6149else if ( ps.chars[ps.charPos] == 'S' ) { 6157if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 6, "SYSTEM" ) ) { 6172else if ( ps.chars[ps.charPos] != '[' && ps.chars[ps.charPos] != '>' ) { 6177if ( ps.chars[ps.charPos] == '[' ) { 6183if ( ps.chars[ps.charPos] != '>' ) { 6187else if ( ps.chars[ps.charPos] == '>' ) { 6198char quoteChar = ps.chars[ps.charPos]; 6213char[] chars = ps.chars; 6365if ( ps.chars[ps.charPos] != (char)0xD ) { 6375chars = ps.chars; 6383char[] chars = ps.chars; 6427sb.Append( ps.chars, ps.charPos, tmp2 ); 6441sb.Append( ps.chars, ps.charPos, tmp3 ); 6451if ( ps.chars[ps.charPos] != (char)0xD ) { 6458chars = ps.chars; 6463Debug.Assert( ps.chars[startPos] == '&' ); 6464if ( ps.chars[startPos + 1] == '#' ) { 6489Debug.Assert( ps.chars[ps.charPos] == '&' ); 6507Debug.Assert( ps.chars[startPos] == '&' && ps.chars[startPos + 1] == '#' ); 6515chars = ps.chars; 6575Throw((ps.chars[startPos + 2] == 'x') ? startPos + 3 : startPos + 2, Res.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(ch, '\0')); 6580internalSubsetBuilder.Append( ps.chars, ps.charPos, pos - ps.charPos + 1 ); 6598Throw((ps.chars[startPos + 2] == 'x') ? startPos + 3 : startPos + 2, Res.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(high, low)); 6605internalSubsetBuilder.Append( ps.chars, ps.charPos, pos - ps.charPos + 1 ); 6632Debug.Assert( ps.chars[ps.charPos] == '&' ); 6651Debug.Assert( ps.chars[startPos] == '&' ); 6652Debug.Assert( ps.chars[startPos + 1] != '#' ); 6655char[] chars = ps.chars; 6744internalSubsetBuilder.Append( ps.chars, ps.charPos, pos - ps.charPos ); 6746ps.chars[pos-1] = ch; 6765char[] chars = ps.chars; 6839chars = ps.chars; 6869if ( ps.chars[endPos] != ';' ) { 6873string entityName = nameTable.Add( ps.chars, ps.charPos, endPos - ps.charPos ); 6921string localName = nameTable.Add( ps.chars, ps.charPos, endNamePos - ps.charPos ); 6928if ( prefixLen == lastPrefix.Length && XmlConvert.StrEqual( ps.chars, startPos, prefixLen, lastPrefix ) ) { 6929return AddAttribute( nameTable.Add( ps.chars, colonPos + 1, endNamePos - colonPos - 1 ), 6934string prefix = nameTable.Add( ps.chars, startPos, prefixLen ); 6936return AddAttribute( nameTable.Add( ps.chars, colonPos + 1, endNamePos - colonPos - 1 ), 7352count = incReadDecoder.Decode( ps.chars, incReadLeftStartPos, charsLeft ); 7385Debug.Assert( XmlConvert.StrEqual( ps.chars, ps.charPos - 2, 2, "?>" ) ); 7392Debug.Assert( XmlConvert.StrEqual( ps.chars, ps.charPos - 3, 3, "-->" ) ); 7399Debug.Assert( XmlConvert.StrEqual( ps.chars, ps.charPos - 3, 3, "]]>" ) ); 7429char[] chars = ps.chars; 7524( ps.chars[endPos] == '>' || xmlCharType.IsWhiteSpace( ps.chars[endPos] ) ) ) { 7532if ( xmlCharType.IsWhiteSpace( ps.chars[endPos] ) ) { 7535if ( ps.chars[ps.charPos] != '>' ) { 7546chars = ps.chars; 7559if ( XmlConvert.StrEqual( ps.chars, ps.charPos + 1, endPos - ps.charPos - 1, curNode.localName ) && 7560( ps.chars[endPos] == '>' || ps.chars[endPos] == '/' || xmlCharType.IsWhiteSpace( ps.chars[endPos] ) ) ) { 7568chars = ps.chars; 7633count = incReadDecoder.Decode( ps.chars, startPos, charsParsed ); 7687char[] chars = ps.chars; 7742chars = ps.chars; 7761chars = ps.chars; 7808chars = ps.chars; 7866if ( xmlCharType.IsNCNameSingleChar( ps.chars[ps.charPos] ) ) { 7868while ( xmlCharType.IsNCNameSingleChar( ps.chars[pos] ) ) { 7871return new string( ps.chars, ps.charPos, pos - ps.charPos ); 7875return new string( ps.chars, ps.charPos, 1 ); 7922if ( v1Compat && pos == ps.charsUsed - 1 && ps.chars[pos] == (char)0 && ReadData() == 0 && ps.isStreamEof ) { 8385charsRead = incReadDecoder.Decode( ps.chars, startPos, endPos - startPos ); 8397curNode.SetValue( ps.chars, startPos, endPos - startPos ); 8399AdjustLineInfo( ps.chars, startPos - charsRead, startPos, ps.eolNormalized, ref incReadLineInfo );
System\Xml\Core\XmlTextReaderImplAsync.cs (129)
665BlockCopyChars( ps.chars, startPos, buffer, ( index + readCount ), copyCount ); 685curNode.SetValue( ps.chars, startPos, endPos - startPos ); 859if ( ps.chars == null || ps.chars.Length < bufferSize + 1 ) { 913if ( ps.chars == null ) { 994if ( ps.charsUsed == ps.chars.Length - 1 ) { 1000char[] newChars = new char[ ps.chars.Length * 2 ]; 1001BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length ); 1016charsRead = ps.chars.Length - ps.charsUsed - 1; 1022int charsLen = ps.chars.Length; 1034BlockCopyChars( ps.chars, ps.charPos, ps.chars, 0, copyCharsCount ); 1040char[] newChars = new char[ ps.chars.Length * 2 ]; 1041BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length ); 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; 1111if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 5, XmlDeclarationBegining ) || 1112xmlCharType.IsNameSingleChar( ps.chars[ps.charPos + 5] ) 1139if ( ps.chars[ps.charPos] == '?' ) { 1142if ( ps.chars[ps.charPos + 1] == '>' ) { 1197switch ( ps.chars[ps.charPos] ) { 1199if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "version" ) && xmlDeclState == 0 ) { 1207if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "encoding" ) && 1217if ( XmlConvert.StrEqual( ps.chars, ps.charPos, nameEndPos - ps.charPos, "standalone" ) && 1233sb.Append( ps.chars, ps.charPos, nameEndPos - ps.charPos ); 1237if ( ps.chars[ps.charPos] != '=' ) { 1239if ( ps.chars[ps.charPos] != '=' ) { 1246char quoteChar = ps.chars[ps.charPos]; 1249quoteChar = ps.chars[ps.charPos]; 1265chars = ps.chars; 1279if ( ps.chars[pos] == quoteChar ) { 1291if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "1.0" ) ) { 1294attr.SetValue( ps.chars, ps.charPos, pos - ps.charPos ); 1299string badVersion = new string( ps.chars, ps.charPos, pos - ps.charPos ); 1304string encName = new string( ps.chars, ps.charPos, pos - ps.charPos ); 1312if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "yes" ) ) { 1315else if ( XmlConvert.StrEqual( ps.chars, ps.charPos, pos - ps.charPos, "no" ) ) { 1323attr.SetValue( ps.chars, ps.charPos, pos - ps.charPos ); 1383char[] chars = ps.chars; 1598char[] chars = ps.chars; 1705char[] chars = ps.chars; 1805char[] chars = ps.chars; 1858char[] chars = ps.chars; 1944char[] chars = ps.chars; 2016chars = ps.chars; 2120args[3] = new string( ps.chars, ps.charPos, endPos - ps.charPos ); 2132char[] chars = ps.chars; 2305chars = ps.chars; 2315chars = ps.chars; 2381chars = ps.chars; 2407chars = ps.chars; 2435char[] chars = ps.chars; 2610chars = ps.chars; 2640if ( ps.chars[ps.charPos] != (char)0xD ) { 2673chars = ps.chars; 2733curNode.SetValueNode(nodeType, ps.chars, startPos, endPos - startPos); 2791curNode.SetValueNode( nodeType, ps.chars, startPos, endPos - startPos ); 2803stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 2814stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 2836curNode.SetValueNode( XmlNodeType.Text, ps.chars, startPos, endPos - startPos ); 2844stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 2856stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 2959Task<Tuple<int, int, int, bool>> task = ParseTextAsync(outOrChars, ps.chars, ps.charPos, 0, -1, outOrChars, (char)0); 3176if (!xmlCharType.IsWhiteSpace(ps.chars[pos - 1])) { 3184chars = ps.chars; 3211chars = ps.chars; 3218ThrowInvalidChar(ps.chars, ps.charsUsed, ps.charPos + offset); 3234if (ps.chars[ps.charPos] != (char)0xD && ps.chars[ps.charPos] != ']') { 3262chars = ps.chars; 3304stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 3312stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 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) ) { 3447if ( xmlCharType.IsCharData( ps.chars[ps.charPos] ) ) { 3451ThrowInvalidChar( ps.chars, ps.charsUsed, ps.charPos ); 3458Debug.Assert( ps.chars[ps.charPos] == '&' ); 3469Debug.Assert( ps.chars[ps.charPos] == '&' ); 3478if ( ps.chars[ps.charPos+1] == '#' ) { 3528if ( ps.chars[endPos] != ';' ) { 3533string entityName = nameTable.Add( ps.chars, ps.charPos, endPos - ps.charPos ); 3643string target = nameTable.Add( ps.chars, ps.charPos, nameEndPos - ps.charPos ); 3660char ch = ps.chars[ps.charPos]; 3666if ( ch != '?' || ps.chars[ps.charPos+1] != '>' ) { 3667Throw( Res.Xml_BadNameChar, XmlException.BuildCharExceptionArgs( ps.chars, ps.charsUsed, ps.charPos ) ); 3685curNode.SetValue( ps.chars, startPos, endPos - startPos ); 3689piInDtdStringBuilder.Append( ps.chars, startPos, endPos - startPos ); 3717sb.Append( ps.chars, startPos, endPos - startPos ); 3725sb.Append( ps.chars, startPos, endPos - startPos ); 3747char[] chars = ps.chars; 3909curNode.SetValueNode( type, ps.chars, startPos, endPos - startPos ); 3916stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 3924stringBuilder.Append( ps.chars, startPos, endPos - startPos ); 3956char[] chars = ps.chars; 4105if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 7, "DOCTYPE" ) ) { 4108if ( !xmlCharType.IsWhiteSpace( ps.chars[ps.charPos + 7] ) ) { 4175if ( ps.chars[ps.charPos] == 'P' ) { 4183if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 6, "PUBLIC" ) ) { 4206else if ( ps.chars[ps.charPos] == 'S' ) { 4214if ( !XmlConvert.StrEqual( ps.chars, ps.charPos, 6, "SYSTEM" ) ) { 4229else if ( ps.chars[ps.charPos] != '[' && ps.chars[ps.charPos] != '>' ) { 4234if ( ps.chars[ps.charPos] == '[' ) { 4240if ( ps.chars[ps.charPos] != '>' ) { 4244else if ( ps.chars[ps.charPos] == '>' ) { 4255char quoteChar = ps.chars[ps.charPos]; 4270char[] chars = ps.chars; 4422if ( ps.chars[ps.charPos] != (char)0xD ) { 4432chars = ps.chars; 4440char[] chars = ps.chars; 4484sb.Append( ps.chars, ps.charPos, tmp2 ); 4498sb.Append( ps.chars, ps.charPos, tmp3 ); 4508if ( ps.chars[ps.charPos] != (char)0xD ) { 4515chars = ps.chars; 4537Debug.Assert( ps.chars[ps.charPos] == '&' ); 4567Debug.Assert( ps.chars[ps.charPos] == '&' ); 4598char[] chars = ps.chars; 4687chars = ps.chars; 4722if ( ps.chars[endPos] != ';' ) { 4726string entityName = nameTable.Add( ps.chars, ps.charPos, endPos - ps.charPos ); 4877if ( v1Compat && pos == ps.charsUsed - 1 && ps.chars[pos] == (char)0 && await ReadDataAsync().ConfigureAwait(false) == 0 && ps.isStreamEof ) { 5026charsRead = incReadDecoder.Decode( ps.chars, startPos, endPos - startPos ); 5038curNode.SetValue( ps.chars, startPos, endPos - startPos ); 5040AdjustLineInfo( ps.chars, startPos - charsRead, startPos, ps.eolNormalized, ref incReadLineInfo );