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

◆ SkipUntil()

void System.Xml.XmlTextReaderImpl.SkipUntil ( char stopChar,
bool recognizeLiterals )
inlineprivate

Definition at line 6328 of file XmlTextReaderImpl.cs.

6329 {
6330 bool flag = false;
6331 bool flag2 = false;
6332 bool flag3 = false;
6333 char c = '"';
6334 char[] chars = _ps.chars;
6335 int num = _ps.charPos;
6336 while (true)
6337 {
6338 char c2;
6339 if (XmlCharType.IsAttributeValueChar(c2 = chars[num]) && chars[num] != stopChar && c2 != '-' && c2 != '?')
6340 {
6341 num++;
6342 continue;
6343 }
6344 if (c2 == stopChar && !flag)
6345 {
6346 break;
6347 }
6348 _ps.charPos = num;
6349 switch (c2)
6350 {
6351 case '\n':
6352 num++;
6353 OnNewLine(num);
6354 continue;
6355 case '\r':
6356 if (chars[num + 1] == '\n')
6357 {
6358 num += 2;
6359 }
6360 else
6361 {
6362 if (num + 1 >= _ps.charsUsed && !_ps.isEof)
6363 {
6364 break;
6365 }
6366 num++;
6367 }
6368 OnNewLine(num);
6369 continue;
6370 case '<':
6371 if (chars[num + 1] == '?')
6372 {
6373 if (recognizeLiterals && !flag && !flag2)
6374 {
6375 flag3 = true;
6376 num += 2;
6377 continue;
6378 }
6379 }
6380 else if (chars[num + 1] == '!')
6381 {
6382 if (num + 3 >= _ps.charsUsed && !_ps.isEof)
6383 {
6384 break;
6385 }
6386 if (chars[num + 2] == '-' && chars[num + 3] == '-' && recognizeLiterals && !flag && !flag3)
6387 {
6388 flag2 = true;
6389 num += 4;
6390 continue;
6391 }
6392 }
6393 else if (num + 1 >= _ps.charsUsed && !_ps.isEof)
6394 {
6395 break;
6396 }
6397 num++;
6398 continue;
6399 case '-':
6400 if (flag2)
6401 {
6402 if (num + 2 >= _ps.charsUsed && !_ps.isEof)
6403 {
6404 break;
6405 }
6406 if (chars[num + 1] == '-' && chars[num + 2] == '>')
6407 {
6408 flag2 = false;
6409 num += 2;
6410 continue;
6411 }
6412 }
6413 num++;
6414 continue;
6415 case '?':
6416 if (flag3)
6417 {
6418 if (num + 1 >= _ps.charsUsed && !_ps.isEof)
6419 {
6420 break;
6421 }
6422 if (chars[num + 1] == '>')
6423 {
6424 flag3 = false;
6425 num++;
6426 continue;
6427 }
6428 }
6429 num++;
6430 continue;
6431 case '\t':
6432 case '&':
6433 case '>':
6434 case ']':
6435 num++;
6436 continue;
6437 case '"':
6438 case '\'':
6439 if (flag)
6440 {
6441 if (c == c2)
6442 {
6443 flag = false;
6444 }
6445 }
6446 else if (recognizeLiterals && !flag2 && !flag3)
6447 {
6448 flag = true;
6449 c = c2;
6450 }
6451 num++;
6452 continue;
6453 default:
6454 {
6455 if (num == _ps.charsUsed)
6456 {
6457 break;
6458 }
6459 char ch = chars[num];
6460 if (XmlCharType.IsHighSurrogate(ch))
6461 {
6462 if (num + 1 == _ps.charsUsed)
6463 {
6464 break;
6465 }
6466 num++;
6467 if (XmlCharType.IsLowSurrogate(chars[num]))
6468 {
6469 num++;
6470 continue;
6471 }
6472 }
6474 break;
6475 }
6476 }
6477 if (ReadData() == 0)
6478 {
6479 if (_ps.charsUsed - _ps.charPos > 0)
6480 {
6481 if (_ps.chars[_ps.charPos] != '\r')
6482 {
6484 }
6485 }
6486 else
6487 {
6489 }
6490 }
6491 chars = _ps.chars;
6492 num = _ps.charPos;
6493 }
6494 _ps.charPos = num + 1;
6495 }
static string Xml_UnexpectedEOF1
Definition SR.cs:38
Definition SR.cs:7
void ThrowInvalidChar(char[] data, int length, int invCharPos)
void Throw(int pos, string res, string arg)

References System.Xml.XmlTextReaderImpl._ps, System.ch, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlCharType.IsAttributeValueChar(), System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.Xml.XmlTextReaderImpl.OnNewLine(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowInvalidChar(), and System.SR.Xml_UnexpectedEOF1.

Referenced by System.Xml.XmlTextReaderImpl.SkipDtd(), and System.Xml.XmlTextReaderImpl.SkipPublicOrSystemIdLiteral().