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

◆ ParseElementContent()

bool System.Xml.XmlTextReaderImpl.ParseElementContent ( )
inlineprivate

Definition at line 4099 of file XmlTextReaderImpl.cs.

4100 {
4101 while (true)
4102 {
4103 int charPos = _ps.charPos;
4104 char[] chars = _ps.chars;
4105 switch (chars[charPos])
4106 {
4107 case '<':
4108 switch (chars[charPos + 1])
4109 {
4110 case '?':
4111 _ps.charPos = charPos + 2;
4112 if (!ParsePI())
4113 {
4114 continue;
4115 }
4116 return true;
4117 case '!':
4118 charPos += 2;
4119 if (_ps.charsUsed - charPos < 2)
4120 {
4121 break;
4122 }
4123 if (chars[charPos] == '-')
4124 {
4125 if (chars[charPos + 1] == '-')
4126 {
4127 _ps.charPos = charPos + 2;
4128 if (!ParseComment())
4129 {
4130 continue;
4131 }
4132 return true;
4133 }
4134 ThrowUnexpectedToken(charPos + 1, "-");
4135 }
4136 else if (chars[charPos] == '[')
4137 {
4138 charPos++;
4139 if (_ps.charsUsed - charPos >= 6)
4140 {
4141 if (XmlConvert.StrEqual(chars, charPos, 6, "CDATA["))
4142 {
4143 _ps.charPos = charPos + 6;
4144 ParseCData();
4145 return true;
4146 }
4147 ThrowUnexpectedToken(charPos, "CDATA[");
4148 }
4149 }
4150 else if (ParseUnexpectedToken(charPos) == "DOCTYPE")
4151 {
4153 }
4154 else
4155 {
4156 ThrowUnexpectedToken(charPos, "<!--", "<[CDATA[");
4157 }
4158 break;
4159 case '/':
4160 _ps.charPos = charPos + 2;
4162 return true;
4163 default:
4164 if (charPos + 1 != _ps.charsUsed)
4165 {
4166 _ps.charPos = charPos + 1;
4167 ParseElement();
4168 return true;
4169 }
4170 break;
4171 }
4172 break;
4173 case '&':
4174 if (!ParseText())
4175 {
4176 continue;
4177 }
4178 return true;
4179 default:
4180 if (charPos != _ps.charsUsed)
4181 {
4182 if (!ParseText())
4183 {
4184 continue;
4185 }
4186 return true;
4187 }
4188 break;
4189 }
4190 if (ReadData() != 0)
4191 {
4192 continue;
4193 }
4194 if (_ps.charsUsed - _ps.charPos != 0)
4195 {
4197 }
4198 if (!InEntity)
4199 {
4200 if (_index == 0 && _fragmentType != XmlNodeType.Document)
4201 {
4202 OnEof();
4203 return false;
4204 }
4206 }
4208 {
4209 break;
4210 }
4211 }
4213 return true;
4214 }
static string Xml_BadDTDLocation
Definition SR.cs:98
Definition SR.cs:7
bool HandleEntityEnd(bool checkEntityNesting)
void Throw(int pos, string res, string arg)
void ThrowUnexpectedToken(int pos, string expectedToken)

References System.Xml.XmlTextReaderImpl._fragmentType, System.Xml.XmlTextReaderImpl._index, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.HandleEntityEnd(), System.Xml.XmlTextReaderImpl.OnEof(), System.Xml.XmlTextReaderImpl.ParseCData(), System.Xml.XmlTextReaderImpl.ParseComment(), System.Xml.XmlTextReaderImpl.ParseElement(), System.Xml.XmlTextReaderImpl.ParseEndElement(), System.Xml.XmlTextReaderImpl.ParsePI(), System.Xml.XmlTextReaderImpl.ParseText(), System.Xml.XmlTextReaderImpl.ParseUnexpectedToken(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.SetupEndEntityNodeInContent(), System.Xml.XmlConvert.StrEqual(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowUnclosedElements(), System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(), and System.SR.Xml_BadDTDLocation.

Referenced by System.Xml.XmlTextReaderImpl.Read().