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

◆ VerifyCharData() [3/3]

static void System.Xml.XmlConvert.VerifyCharData ( string data,
ExceptionType invCharExceptionType,
ExceptionType invSurrogateExceptionType )
inlinestaticpackage

Definition at line 1252 of file XmlConvert.cs.

1253 {
1254 if (data == null || data.Length == 0)
1255 {
1256 return;
1257 }
1258 int num = 0;
1259 int length = data.Length;
1260 while (true)
1261 {
1262 if (num < length && XmlCharType.IsCharData(data[num]))
1263 {
1264 num++;
1265 continue;
1266 }
1267 if (num == length)
1268 {
1269 return;
1270 }
1271 char ch = data[num];
1272 if (!XmlCharType.IsHighSurrogate(ch))
1273 {
1274 break;
1275 }
1276 if (num + 1 == length)
1277 {
1279 }
1280 ch = data[num + 1];
1281 if (XmlCharType.IsLowSurrogate(ch))
1282 {
1283 num += 2;
1284 continue;
1285 }
1286 throw CreateInvalidSurrogatePairException(data[num + 1], data[num], invSurrogateExceptionType, 0, num + 1);
1287 }
1289 }
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.length, and System.SR.Xml_InvalidSurrogateMissingLowChar.