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

◆ WriteRawWithSurrogateChecking()

void System.Xml.XmlTextEncoder.WriteRawWithSurrogateChecking ( string text)
inlinepackage

Definition at line 340 of file XmlTextEncoder.cs.

341 {
342 if (text == null)
343 {
344 return;
345 }
346 if (_cacheAttrValue)
347 {
349 }
350 int length = text.Length;
351 int num = 0;
352 char c = '\0';
353 while (true)
354 {
355 if (num < length && (XmlCharType.IsCharData(c = text[num]) || c < ' '))
356 {
357 num++;
358 continue;
359 }
360 if (num == length)
361 {
362 break;
363 }
364 if (XmlCharType.IsHighSurrogate(c))
365 {
366 if (num + 1 >= length)
367 {
369 }
370 char c2 = text[num + 1];
371 if (!XmlCharType.IsLowSurrogate(c2))
372 {
373 throw XmlConvert.CreateInvalidSurrogatePairException(c2, c);
374 }
375 num += 2;
376 }
377 else
378 {
379 if (XmlCharType.IsLowSurrogate(c))
380 {
381 throw XmlConvert.CreateInvalidHighSurrogateCharException(c);
382 }
383 num++;
384 }
385 }
387 }
virtual void Write(char value)
static string Xml_InvalidSurrogateMissingLowChar
Definition SR.cs:324
Definition SR.cs:7
StringBuilder Append(char value, int repeatCount)
readonly TextWriter _textWriter

References System.Xml.XmlTextEncoder._attrValue, System.Xml.XmlTextEncoder._cacheAttrValue, System.Xml.XmlTextEncoder._textWriter, System.Text.StringBuilder.Append(), System.Xml.ArgumentException, System.Xml.XmlConvert.CreateInvalidHighSurrogateCharException(), System.Xml.XmlConvert.CreateInvalidSurrogatePairException(), System.Xml.Dictionary, System.Xml.XmlCharType.IsCharData(), System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.length, System.Text.StringBuilder.Length, System.text, System.IO.TextWriter.Write(), and System.SR.Xml_InvalidSurrogateMissingLowChar.