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

◆ ParseTextAsync() [3/3]

Task<(int, int, int, bool)> System.Xml.XmlTextReaderImpl.ParseTextAsync ( int outOrChars,
char[] chars,
int pos,
int rcount,
int rpos,
int orChars,
char c )
inlineprivate

Definition at line 11146 of file XmlTextReaderImpl.cs.

11147 {
11148 while (true)
11149 {
11150 if (XmlCharType.IsTextChar(c = chars[pos]))
11151 {
11152 orChars |= c;
11153 pos++;
11154 continue;
11155 }
11156 switch (c)
11157 {
11158 case '\t':
11159 pos++;
11160 break;
11161 case '\n':
11162 pos++;
11163 OnNewLine(pos);
11164 break;
11165 case '\r':
11166 if (chars[pos + 1] == '\n')
11167 {
11168 if (!_ps.eolNormalized && _parsingMode == ParsingMode.Full)
11169 {
11170 if (pos - _ps.charPos > 0)
11171 {
11172 if (rcount == 0)
11173 {
11174 rcount = 1;
11175 rpos = pos;
11176 }
11177 else
11178 {
11179 ShiftBuffer(rpos + rcount, rpos, pos - rpos - rcount);
11180 rpos = pos - rcount;
11181 rcount++;
11182 }
11183 }
11184 else
11185 {
11186 _ps.charPos++;
11187 }
11188 }
11189 pos += 2;
11190 }
11191 else
11192 {
11193 if (pos + 1 >= _ps.charsUsed && !_ps.isEof)
11194 {
11195 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11196 _parseText_NextFunction = ParseTextFunction.ReadData;
11197 return _parseText_dummyTask;
11198 }
11199 if (!_ps.eolNormalized)
11200 {
11201 chars[pos] = '\n';
11202 }
11203 pos++;
11204 }
11205 OnNewLine(pos);
11206 break;
11207 case '<':
11208 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11209 _parseText_NextFunction = ParseTextFunction.PartialValue;
11210 return _parseText_dummyTask;
11211 case '&':
11212 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11213 _parseText_NextFunction = ParseTextFunction.Entity;
11214 return _parseText_dummyTask;
11215 case ']':
11216 if (_ps.charsUsed - pos < 3 && !_ps.isEof)
11217 {
11218 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11219 _parseText_NextFunction = ParseTextFunction.ReadData;
11220 return _parseText_dummyTask;
11221 }
11222 if (chars[pos + 1] == ']' && chars[pos + 2] == '>')
11223 {
11225 }
11226 orChars |= 0x5D;
11227 pos++;
11228 break;
11229 default:
11230 if (pos == _ps.charsUsed)
11231 {
11232 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11233 _parseText_NextFunction = ParseTextFunction.ReadData;
11234 return _parseText_dummyTask;
11235 }
11236 _lastParseTextState = new ParseTextState(outOrChars, chars, pos, rcount, rpos, orChars, c);
11237 _parseText_NextFunction = ParseTextFunction.Surrogate;
11238 return _parseText_dummyTask;
11239 }
11240 }
11241 }
static string Xml_CDATAEndInText
Definition SR.cs:150
Definition SR.cs:7
readonly Task<(int, int, int, bool)> _parseText_dummyTask
ParseTextFunction _parseText_NextFunction
void Throw(int pos, string res, string arg)
void ShiftBuffer(int sourcePos, int destPos, int count)

References System.Xml.XmlTextReaderImpl._lastParseTextState, System.Xml.XmlTextReaderImpl._parseText_dummyTask, System.Xml.XmlTextReaderImpl._parseText_NextFunction, System.Xml.XmlTextReaderImpl._parsingMode, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.XmlTextReaderImpl.ParsingState.eolNormalized, System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlCharType.IsTextChar(), System.Xml.XmlTextReaderImpl.OnNewLine(), System.Xml.XmlTextReaderImpl.ShiftBuffer(), System.Xml.XmlTextReaderImpl.Throw(), and System.SR.Xml_CDATAEndInText.