Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EatWhitespacesAsync()

async Task< int > System.Xml.XmlTextReaderImpl.EatWhitespacesAsync ( StringBuilder sb)
inlineprivate

Definition at line 12450 of file XmlTextReaderImpl.cs.

12451 {
12452 int num = _ps.charPos;
12453 int wsCount = 0;
12454 char[] chars = _ps.chars;
12455 while (true)
12456 {
12457 switch (chars[num])
12458 {
12459 case '\n':
12460 num++;
12461 OnNewLine(num);
12462 continue;
12463 case '\r':
12464 if (chars[num + 1] == '\n')
12465 {
12466 int num3 = num - _ps.charPos;
12467 if (sb != null && !_ps.eolNormalized)
12468 {
12469 if (num3 > 0)
12470 {
12471 sb.Append(chars, _ps.charPos, num3);
12472 wsCount += num3;
12473 }
12474 _ps.charPos = num + 1;
12475 }
12476 num += 2;
12477 }
12478 else
12479 {
12480 if (num + 1 >= _ps.charsUsed && !_ps.isEof)
12481 {
12482 break;
12483 }
12484 if (!_ps.eolNormalized)
12485 {
12486 chars[num] = '\n';
12487 }
12488 num++;
12489 }
12490 OnNewLine(num);
12491 continue;
12492 case '\t':
12493 case ' ':
12494 num++;
12495 continue;
12496 default:
12497 if (num != _ps.charsUsed)
12498 {
12499 int num2 = num - _ps.charPos;
12500 if (num2 > 0)
12501 {
12502 sb?.Append(_ps.chars, _ps.charPos, num2);
12503 _ps.charPos = num;
12504 wsCount += num2;
12505 }
12506 return wsCount;
12507 }
12508 break;
12509 }
12510 int num4 = num - _ps.charPos;
12511 if (num4 > 0)
12512 {
12513 sb?.Append(_ps.chars, _ps.charPos, num4);
12514 _ps.charPos = num;
12515 wsCount += num4;
12516 }
12517 if (await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false) == 0)
12518 {
12519 if (_ps.charsUsed - _ps.charPos == 0)
12520 {
12521 break;
12522 }
12523 if (_ps.chars[_ps.charPos] != '\r')
12524 {
12526 }
12527 }
12528 num = _ps.charPos;
12529 chars = _ps.chars;
12530 }
12531 return wsCount;
12532 }
static string Xml_UnexpectedEOF1
Definition SR.cs:38
Definition SR.cs:7
StringBuilder Append(char value, int repeatCount)
void Throw(int pos, string res, string arg)

References System.Xml.XmlTextReaderImpl._ps, System.Text.StringBuilder.Append(), System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.ParsingState.eolNormalized, System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlTextReaderImpl.OnNewLine(), System.Xml.XmlTextReaderImpl.ReadDataAsync(), System.Xml.XmlTextReaderImpl.Throw(), and System.SR.Xml_UnexpectedEOF1.

Referenced by System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubsetAsync(), System.Xml.XmlTextReaderImpl.ParseAttributesAsync(), System.Xml.XmlTextReaderImpl.ParseDoctypeDeclAsync(), System.Xml.XmlTextReaderImpl.ParsePIAsync(), System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespaceAsync(), System.Xml.XmlTextReaderImpl.ParseXmlDeclarationAsync(), System.Xml.XmlTextReaderImpl.PushExternalEntityAsync(), and System.Xml.XmlTextReaderImpl.SkipDtdAsync().