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

◆ EatWhitespaces()

int System.Xml.XmlTextReaderImpl.EatWhitespaces ( StringBuilder sb)
inlineprivate

Definition at line 6497 of file XmlTextReaderImpl.cs.

6498 {
6499 int num = _ps.charPos;
6500 int num2 = 0;
6501 char[] chars = _ps.chars;
6502 while (true)
6503 {
6504 switch (chars[num])
6505 {
6506 case '\n':
6507 num++;
6508 OnNewLine(num);
6509 continue;
6510 case '\r':
6511 if (chars[num + 1] == '\n')
6512 {
6513 int num4 = num - _ps.charPos;
6514 if (sb != null && !_ps.eolNormalized)
6515 {
6516 if (num4 > 0)
6517 {
6518 sb.Append(chars, _ps.charPos, num4);
6519 num2 += num4;
6520 }
6521 _ps.charPos = num + 1;
6522 }
6523 num += 2;
6524 }
6525 else
6526 {
6527 if (num + 1 >= _ps.charsUsed && !_ps.isEof)
6528 {
6529 break;
6530 }
6531 if (!_ps.eolNormalized)
6532 {
6533 chars[num] = '\n';
6534 }
6535 num++;
6536 }
6537 OnNewLine(num);
6538 continue;
6539 case '\t':
6540 case ' ':
6541 num++;
6542 continue;
6543 default:
6544 if (num != _ps.charsUsed)
6545 {
6546 int num3 = num - _ps.charPos;
6547 if (num3 > 0)
6548 {
6549 sb?.Append(_ps.chars, _ps.charPos, num3);
6550 _ps.charPos = num;
6551 num2 += num3;
6552 }
6553 return num2;
6554 }
6555 break;
6556 }
6557 int num5 = num - _ps.charPos;
6558 if (num5 > 0)
6559 {
6560 sb?.Append(_ps.chars, _ps.charPos, num5);
6561 _ps.charPos = num;
6562 num2 += num5;
6563 }
6564 if (ReadData() == 0)
6565 {
6566 if (_ps.charsUsed - _ps.charPos == 0)
6567 {
6568 break;
6569 }
6570 if (_ps.chars[_ps.charPos] != '\r')
6571 {
6573 }
6574 }
6575 num = _ps.charPos;
6576 chars = _ps.chars;
6577 }
6578 return num2;
6579 }
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.ReadData(), System.Xml.XmlTextReaderImpl.Throw(), and System.SR.Xml_UnexpectedEOF1.

Referenced by System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(), System.Xml.XmlTextReaderImpl.IncrementalRead(), System.Xml.XmlTextReaderImpl.ParseAttributes(), System.Xml.XmlTextReaderImpl.ParseDoctypeDecl(), System.Xml.XmlTextReaderImpl.ParsePI(), System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace(), System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(), System.Xml.XmlTextReaderImpl.PushExternalEntity(), and System.Xml.XmlTextReaderImpl.SkipDtd().