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

◆ VerifyCharData() [1/3]

static void System.Xml.XmlConvert.VerifyCharData ( char[] data,
int offset,
int len,
ExceptionType exceptionType )
inlinestaticpackage

Definition at line 1291 of file XmlConvert.cs.

1292 {
1293 if (data == null || len == 0)
1294 {
1295 return;
1296 }
1297 int num = offset;
1298 int num2 = offset + len;
1299 while (true)
1300 {
1301 if (num < num2 && XmlCharType.IsCharData(data[num]))
1302 {
1303 num++;
1304 continue;
1305 }
1306 if (num == num2)
1307 {
1308 return;
1309 }
1310 char ch = data[num];
1311 if (!XmlCharType.IsHighSurrogate(ch))
1312 {
1313 break;
1314 }
1315 if (num + 1 == num2)
1316 {
1318 }
1319 ch = data[num + 1];
1320 if (XmlCharType.IsLowSurrogate(ch))
1321 {
1322 num += 2;
1323 continue;
1324 }
1325 throw CreateInvalidSurrogatePairException(data[num + 1], data[num], exceptionType, 0, offset - num + 1);
1326 }
1327 throw CreateInvalidCharException(data, len, num, exceptionType);
1328 }
static string Xml_InvalidSurrogateMissingLowChar
Definition SR.cs:324
Definition SR.cs:7
static Exception CreateInvalidCharException(char[] data, int length, int invCharPos, ExceptionType exceptionType)
static Exception CreateInvalidSurrogatePairException(char low, char hi)
static Exception CreateException(string res, ExceptionType exceptionType, int lineNo, int linePos)

References System.ch, System.Xml.XmlConvert.CreateException(), System.Xml.XmlConvert.CreateInvalidCharException(), System.Xml.XmlConvert.CreateInvalidSurrogatePairException(), System.Xml.Dictionary, System.Xml.XmlCharType.IsCharData(), System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.len, System.offset, and System.SR.Xml_InvalidSurrogateMissingLowChar.