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