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

◆ ParsePIValue()

bool System.Xml.XmlTextReaderImpl.ParsePIValue ( out int outStartPos,
out int outEndPos )
inlineprivate

Definition at line 5858 of file XmlTextReaderImpl.cs.

5859 {
5860 if (_ps.charsUsed - _ps.charPos < 2 && ReadData() == 0)
5861 {
5863 }
5864 int num = _ps.charPos;
5865 char[] chars = _ps.chars;
5866 int num2 = 0;
5867 int num3 = -1;
5868 while (true)
5869 {
5870 char c;
5871 if (XmlCharType.IsTextChar(c = chars[num]) && c != '?')
5872 {
5873 num++;
5874 continue;
5875 }
5876 switch (chars[num])
5877 {
5878 case '?':
5879 if (chars[num + 1] == '>')
5880 {
5881 if (num2 > 0)
5882 {
5883 ShiftBuffer(num3 + num2, num3, num - num3 - num2);
5884 outEndPos = num - num2;
5885 }
5886 else
5887 {
5888 outEndPos = num;
5889 }
5891 _ps.charPos = num + 2;
5892 return true;
5893 }
5894 if (num + 1 != _ps.charsUsed)
5895 {
5896 num++;
5897 continue;
5898 }
5899 break;
5900 case '\n':
5901 num++;
5902 OnNewLine(num);
5903 continue;
5904 case '\r':
5905 if (chars[num + 1] == '\n')
5906 {
5907 if (!_ps.eolNormalized && _parsingMode == ParsingMode.Full)
5908 {
5909 if (num - _ps.charPos > 0)
5910 {
5911 if (num2 == 0)
5912 {
5913 num2 = 1;
5914 num3 = num;
5915 }
5916 else
5917 {
5918 ShiftBuffer(num3 + num2, num3, num - num3 - num2);
5919 num3 = num - num2;
5920 num2++;
5921 }
5922 }
5923 else
5924 {
5925 _ps.charPos++;
5926 }
5927 }
5928 num += 2;
5929 }
5930 else
5931 {
5932 if (num + 1 >= _ps.charsUsed && !_ps.isEof)
5933 {
5934 break;
5935 }
5936 if (!_ps.eolNormalized)
5937 {
5938 chars[num] = '\n';
5939 }
5940 num++;
5941 }
5942 OnNewLine(num);
5943 continue;
5944 case '\t':
5945 case '&':
5946 case '<':
5947 case ']':
5948 num++;
5949 continue;
5950 default:
5951 {
5952 if (num == _ps.charsUsed)
5953 {
5954 break;
5955 }
5956 char ch = chars[num];
5957 if (XmlCharType.IsHighSurrogate(ch))
5958 {
5959 if (num + 1 == _ps.charsUsed)
5960 {
5961 break;
5962 }
5963 num++;
5964 if (XmlCharType.IsLowSurrogate(chars[num]))
5965 {
5966 num++;
5967 continue;
5968 }
5969 }
5971 continue;
5972 }
5973 }
5974 break;
5975 }
5976 if (num2 > 0)
5977 {
5978 ShiftBuffer(num3 + num2, num3, num - num3 - num2);
5979 outEndPos = num - num2;
5980 }
5981 else
5982 {
5983 outEndPos = num;
5984 }
5986 _ps.charPos = num;
5987 return false;
5988 }
static string Xml_UnexpectedEOF
Definition SR.cs:36
Definition SR.cs:7
void ThrowInvalidChar(char[] data, int length, int invCharPos)
void Throw(int pos, string res, string arg)
void ShiftBuffer(int sourcePos, int destPos, int count)

References System.Xml.XmlTextReaderImpl._parsingMode, 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.XmlTextReaderImpl.ParsingState.eolNormalized, System.Xml.XmlTextReaderImpl.ParsingState.isEof, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.Xml.XmlCharType.IsTextChar(), System.Xml.XmlTextReaderImpl.OnNewLine(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.ShiftBuffer(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowInvalidChar(), and System.SR.Xml_UnexpectedEOF.

Referenced by System.Xml.XmlTextReaderImpl.IncrementalRead(), and System.Xml.XmlTextReaderImpl.ParsePI().