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

◆ ReadPartialUnicodeText()

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

Definition at line 1054 of file XmlBinaryReader.cs.

1055 {
1056 int num = Math.Max(_maxBytesPerRead - 5, 0);
1057 if (length <= num)
1058 {
1059 if (withEndElement)
1060 {
1061 ReadText(MoveToAtomicTextWithEndElement(), ValueHandleType.Unicode, length);
1062 }
1063 else
1064 {
1065 ReadText(MoveToComplexText(), ValueHandleType.Unicode, length);
1066 }
1067 return;
1068 }
1069 int num2 = Math.Max(num - 5, 0);
1070 if (((uint)num2 & (true ? 1u : 0u)) != 0)
1071 {
1072 num2--;
1073 }
1074 int num3 = base.BufferReader.ReadBytes(num2);
1075 int num4 = 0;
1076 char c = (char)base.BufferReader.GetInt16(num3 + num2 - 2);
1077 if (c >= '\ud800' && c < '\udc00')
1078 {
1079 num4 = 2;
1080 }
1082 num2 -= num4;
1083 MoveToComplexText().Value.SetValue(ValueHandleType.Unicode, num3, num2);
1084 if (base.OutsideRootElement)
1085 {
1087 }
1088 XmlBinaryNodeType nodeType = (withEndElement ? XmlBinaryNodeType.UnicodeChars32TextWithEndElement : XmlBinaryNodeType.UnicodeChars32Text);
1089 InsertNode(nodeType, length - num2);
1090 }
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.ReadUnicodeText().