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

◆ ReadPartialUTF8Text()

void System.Xml.XmlBinaryReader.ReadPartialUTF8Text ( bool withEndElement,
int length )
inlineprivate

Definition at line 993 of file XmlBinaryReader.cs.

994 {
995 int num = Math.Max(_maxBytesPerRead - 5, 0);
996 if (length <= num)
997 {
998 if (withEndElement)
999 {
1000 ReadText(MoveToAtomicTextWithEndElement(), ValueHandleType.UTF8, length);
1001 }
1002 else
1003 {
1004 ReadText(MoveToComplexText(), ValueHandleType.UTF8, length);
1005 }
1006 return;
1007 }
1008 int num2 = Math.Max(num - 5, 0);
1009 int num3 = base.BufferReader.ReadBytes(num2);
1010 int num4;
1011 for (num4 = num3 + num2 - 1; num4 >= num3; num4--)
1012 {
1013 byte @byte = base.BufferReader.GetByte(num4);
1014 if ((@byte & 0x80) == 0 || (@byte & 0xC0) == 192)
1015 {
1016 break;
1017 }
1018 }
1019 int num5 = num3 + num2 - num4;
1021 num2 -= num5;
1022 MoveToComplexText().Value.SetValue(ValueHandleType.UTF8, num3, num2);
1023 if (base.OutsideRootElement)
1024 {
1026 }
1027 XmlBinaryNodeType nodeType = (withEndElement ? XmlBinaryNodeType.Chars32TextWithEndElement : XmlBinaryNodeType.Chars32Text);
1028 InsertNode(nodeType, length - num2);
1029 }
void SetValue(ValueHandleType type)
XmlComplexTextNode MoveToComplexText()
void InsertNode(XmlBinaryNodeType nodeType, int length)
void ReadText(XmlTextNode textNode, ValueHandleType type, int length)
XmlAtomicTextNode MoveToAtomicTextWithEndElement()

References System.Xml.XmlBinaryReader._maxBytesPerRead, System.Xml.Dictionary, System.Xml.XmlBinaryReader.InsertNode(), System.length, System.Math.Max(), System.Xml.XmlBinaryReader.MoveToAtomicTextWithEndElement(), System.Xml.XmlBaseReader.MoveToComplexText(), System.Xml.XmlBinaryReader.ReadText(), System.Xml.ValueHandle.SetValue(), System.Xml.XmlBaseReader.XmlNode.Value, and System.Xml.XmlBinaryReader.VerifyWhitespace().

Referenced by System.Xml.XmlBinaryReader.ReadNode().