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

◆ ReadData()

int System.Xml.XmlTextReaderImpl.ReadData ( )
inlineprivate

Definition at line 3452 of file XmlTextReaderImpl.cs.

3453 {
3454 if (_ps.isEof)
3455 {
3456 return 0;
3457 }
3458 int num;
3459 if (_ps.appendMode)
3460 {
3461 if (_ps.charsUsed == _ps.chars.Length - 1)
3462 {
3463 for (int i = 0; i < _attrCount; i++)
3464 {
3466 }
3467 char[] array = new char[_ps.chars.Length * 2];
3468 BlockCopyChars(_ps.chars, 0, array, 0, _ps.chars.Length);
3469 _ps.chars = array;
3470 }
3471 if (_ps.stream != null && _ps.bytesUsed - _ps.bytePos < 6 && _ps.bytes.Length - _ps.bytesUsed < 6)
3472 {
3473 byte[] array2 = new byte[_ps.bytes.Length * 2];
3475 _ps.bytes = array2;
3476 }
3477 num = _ps.chars.Length - _ps.charsUsed - 1;
3478 if (num > 80)
3479 {
3480 num = 80;
3481 }
3482 }
3483 else
3484 {
3485 int num2 = _ps.chars.Length;
3486 if (num2 - _ps.charsUsed <= num2 / 2)
3487 {
3488 for (int j = 0; j < _attrCount; j++)
3489 {
3491 }
3492 int num3 = _ps.charsUsed - _ps.charPos;
3493 if (num3 < num2 - 1)
3494 {
3496 if (num3 > 0)
3497 {
3499 }
3500 _ps.charPos = 0;
3502 }
3503 else
3504 {
3505 char[] array3 = new char[_ps.chars.Length * 2];
3506 BlockCopyChars(_ps.chars, 0, array3, 0, _ps.chars.Length);
3507 _ps.chars = array3;
3508 }
3509 }
3510 if (_ps.stream != null)
3511 {
3512 int num4 = _ps.bytesUsed - _ps.bytePos;
3513 if (num4 <= 128)
3514 {
3515 if (num4 == 0)
3516 {
3517 _ps.bytesUsed = 0;
3518 }
3519 else
3520 {
3523 }
3524 _ps.bytePos = 0;
3525 }
3526 }
3527 num = _ps.chars.Length - _ps.charsUsed - 1;
3528 }
3529 if (_ps.stream != null)
3530 {
3531 if (!_ps.isStreamEof && _ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0)
3532 {
3534 if (num5 == 0)
3535 {
3536 _ps.isStreamEof = true;
3537 }
3539 }
3540 int bytePos = _ps.bytePos;
3541 num = GetChars(num);
3542 if (num == 0 && _ps.bytePos != bytePos)
3543 {
3544 return ReadData();
3545 }
3546 }
3547 else if (_ps.textReader != null)
3548 {
3549 num = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1);
3550 _ps.charsUsed += num;
3551 }
3552 else
3553 {
3554 num = 0;
3555 }
3557 if (num == 0)
3558 {
3559 _ps.isEof = true;
3560 }
3561 _ps.chars[_ps.charsUsed] = '\0';
3562 return num;
3563 }
int Read(byte[] buffer, int offset, int count)
virtual int Read()
static void BlockCopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
int GetChars(int maxCharsCount)
void RegisterConsumedCharacters(long characters, bool inEntityReference)
static void BlockCopyChars(char[] src, int srcOffset, char[] dst, int dstOffset, int count)

References System.Xml.XmlTextReaderImpl._attrCount, System.Xml.XmlTextReaderImpl._index, System.Xml.XmlTextReaderImpl._nodes, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.appendMode, System.array, System.Xml.XmlTextReaderImpl.BlockCopy(), System.Xml.XmlTextReaderImpl.BlockCopyChars(), System.Xml.XmlTextReaderImpl.ParsingState.bytePos, System.Xml.XmlTextReaderImpl.ParsingState.bytes, System.Xml.XmlTextReaderImpl.ParsingState.bytesUsed, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.GetChars(), System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlTextReaderImpl.ParsingState.isStreamEof, System.Xml.XmlTextReaderImpl.NodeData.OnBufferInvalidated(), System.IO.TextReader.Read(), System.IO.Stream.Read(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.RegisterConsumedCharacters(), System.Xml.XmlTextReaderImpl.ParsingState.stream, and System.Xml.XmlTextReaderImpl.ParsingState.textReader.

Referenced by System.Xml.XmlTextReaderImpl.DtdParserProxy_ReadData(), System.Xml.XmlTextReaderImpl.EatWhitespaces(), System.Xml.XmlTextReaderImpl.GetRemainder(), System.Xml.XmlTextReaderImpl.HandleEntityReference(), System.Xml.XmlTextReaderImpl.IncrementalRead(), System.Xml.XmlTextReaderImpl.InitStreamInput(), System.Xml.XmlTextReaderImpl.InitTextReaderInput(), System.Xml.XmlTextReaderImpl.ParseAttributes(), System.Xml.XmlTextReaderImpl.ParseAttributeValueChunk(), System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(), System.Xml.XmlTextReaderImpl.ParseCDataOrComment(), System.Xml.XmlTextReaderImpl.ParseDoctypeDecl(), System.Xml.XmlTextReaderImpl.ParseDocumentContent(), System.Xml.XmlTextReaderImpl.ParseElement(), System.Xml.XmlTextReaderImpl.ParseElementContent(), System.Xml.XmlTextReaderImpl.ParseEndElement(), System.Xml.XmlTextReaderImpl.ParseNamedCharRef(), System.Xml.XmlTextReaderImpl.ParseNumericCharRef(), System.Xml.XmlTextReaderImpl.ParsePI(), System.Xml.XmlTextReaderImpl.ParsePIValue(), System.Xml.XmlTextReaderImpl.ParseText(), System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.ReadDataInName(), System.Xml.XmlTextReaderImpl.SkipDtd(), System.Xml.XmlTextReaderImpl.SkipUntil(), System.Xml.XmlTextReaderImpl.SwitchEncoding(), and System.Xml.XmlTextReaderImpl.ZeroEndingStream().