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

◆ ParseQNameAsync() [2/2]

async Task<(int, int)> System.Xml.XmlTextReaderImpl.ParseQNameAsync ( bool isQName,
int startOffset )
inlineprivate

Definition at line 12590 of file XmlTextReaderImpl.cs.

12591 {
12592 int colonOffset = -1;
12593 int num = _ps.charPos + startOffset;
12594 while (true)
12595 {
12596 char[] chars = _ps.chars;
12597 if (XmlCharType.IsStartNCNameSingleChar(chars[num]))
12598 {
12599 num++;
12600 }
12601 else if (num + 1 >= _ps.charsUsed)
12602 {
12604 (num, _) = tuple;
12605 if (tuple.Item2)
12606 {
12607 continue;
12608 }
12609 Throw(num, System.SR.Xml_UnexpectedEOF, "Name");
12610 }
12611 else if (chars[num] != ':' || _supportNamespaces)
12612 {
12613 Throw(num, System.SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.charsUsed, num));
12614 }
12615 while (true)
12616 {
12617 if (XmlCharType.IsNCNameSingleChar(chars[num]))
12618 {
12619 num++;
12620 continue;
12621 }
12622 if (chars[num] == ':')
12623 {
12625 {
12626 break;
12627 }
12628 colonOffset = num - _ps.charPos;
12629 num++;
12630 continue;
12631 }
12632 if (num == _ps.charsUsed)
12633 {
12635 (num, _) = tuple3;
12636 if (tuple3.Item2)
12637 {
12638 chars = _ps.chars;
12639 continue;
12640 }
12641 Throw(num, System.SR.Xml_UnexpectedEOF, "Name");
12642 }
12643 int item = ((colonOffset == -1) ? (-1) : (_ps.charPos + colonOffset));
12644 return (item, num);
12645 }
12646 if (colonOffset != -1 || !isQName)
12647 {
12648 Throw(num, System.SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(':', '\0'));
12649 }
12650 colonOffset = num - _ps.charPos;
12651 num++;
12652 }
12653 }
static string Xml_BadStartNameChar
Definition SR.cs:42
static string Xml_BadNameChar
Definition SR.cs:44
static string Xml_UnexpectedEOF
Definition SR.cs:36
Definition SR.cs:7
async Task<(int, bool)> ReadDataInNameAsync(int pos)
void Throw(int pos, string res, string arg)

References System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._supportNamespaces, System.Xml.XmlException.BuildCharExceptionArgs(), System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.int, System.Xml.XmlCharType.IsNCNameSingleChar(), System.Xml.XmlCharType.IsStartNCNameSingleChar(), System.item, System.Xml.XmlTextReaderImpl.ReadDataInNameAsync(), System.Xml.XmlTextReaderImpl.Throw(), System.SR.Xml_BadNameChar, System.SR.Xml_BadStartNameChar, and System.SR.Xml_UnexpectedEOF.