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

◆ ParseQName() [1/2]

int System.Xml.XmlTextReaderImpl.ParseQName ( bool isQName,
int startOffset,
out int colonPos )
inlineprivate

Definition at line 6840 of file XmlTextReaderImpl.cs.

6841 {
6842 int num = -1;
6843 int pos = _ps.charPos + startOffset;
6844 while (true)
6845 {
6846 char[] chars = _ps.chars;
6847 if (XmlCharType.IsStartNCNameSingleChar(chars[pos]))
6848 {
6849 pos++;
6850 }
6851 else
6852 {
6853 if (pos + 1 >= _ps.charsUsed)
6854 {
6855 if (ReadDataInName(ref pos))
6856 {
6857 continue;
6858 }
6859 Throw(pos, System.SR.Xml_UnexpectedEOF, "Name");
6860 }
6861 if (chars[pos] != ':' || _supportNamespaces)
6862 {
6863 Throw(pos, System.SR.Xml_BadStartNameChar, XmlException.BuildCharExceptionArgs(chars, _ps.charsUsed, pos));
6864 }
6865 }
6866 while (true)
6867 {
6868 if (XmlCharType.IsNCNameSingleChar(chars[pos]))
6869 {
6870 pos++;
6871 continue;
6872 }
6873 if (chars[pos] == ':')
6874 {
6876 {
6877 break;
6878 }
6879 num = pos - _ps.charPos;
6880 pos++;
6881 continue;
6882 }
6883 if (pos == _ps.charsUsed)
6884 {
6885 if (ReadDataInName(ref pos))
6886 {
6887 chars = _ps.chars;
6888 continue;
6889 }
6890 Throw(pos, System.SR.Xml_UnexpectedEOF, "Name");
6891 }
6892 colonPos = ((num == -1) ? (-1) : (_ps.charPos + num));
6893 return pos;
6894 }
6895 if (num != -1 || !isQName)
6896 {
6897 Throw(pos, System.SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(':', '\0'));
6898 }
6899 num = pos - _ps.charPos;
6900 pos++;
6901 }
6902 }
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
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.XmlCharType.IsNCNameSingleChar(), System.Xml.XmlCharType.IsStartNCNameSingleChar(), System.Xml.XmlTextReaderImpl.ReadDataInName(), System.Xml.XmlTextReaderImpl.Throw(), System.SR.Xml_BadNameChar, System.SR.Xml_BadStartNameChar, and System.SR.Xml_UnexpectedEOF.