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

◆ WriteElementTextBlock()

unsafe void System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock ( char * pSrc,
char * pSrcEnd )
inlineprotectedinherited

Definition at line 635 of file XmlUtf8RawTextWriter.cs.

636 {
637 fixed (byte* ptr = _bufBytes)
638 {
639 byte* ptr2 = ptr + _bufPos;
640 int num = 0;
641 while (true)
642 {
643 byte* ptr3 = ptr2 + (pSrcEnd - pSrc);
644 if (ptr3 > ptr + _bufLen)
645 {
646 ptr3 = ptr + _bufLen;
647 }
648 while (ptr2 < ptr3 && XmlCharType.IsAttributeValueChar((char)(num = *pSrc)) && num <= 127)
649 {
650 *ptr2 = (byte)num;
651 ptr2++;
652 pSrc++;
653 }
654 if (pSrc >= pSrcEnd)
655 {
656 break;
657 }
658 if (ptr2 >= ptr3)
659 {
660 _bufPos = (int)(ptr2 - ptr);
661 FlushBuffer();
662 ptr2 = ptr + 1;
663 continue;
664 }
665 switch (num)
666 {
667 case 38:
669 break;
670 case 60:
671 ptr2 = LtEntity(ptr2);
672 break;
673 case 62:
674 ptr2 = GtEntity(ptr2);
675 break;
676 case 9:
677 case 34:
678 case 39:
679 *ptr2 = (byte)num;
680 ptr2++;
681 break;
682 case 10:
683 if (_newLineHandling == NewLineHandling.Replace)
684 {
686 break;
687 }
688 *ptr2 = (byte)num;
689 ptr2++;
690 break;
691 case 13:
692 switch (_newLineHandling)
693 {
694 case NewLineHandling.Replace:
695 if (pSrc + 1 < pSrcEnd && pSrc[1] == '\n')
696 {
697 pSrc++;
698 }
700 break;
701 case NewLineHandling.Entitize:
703 break;
704 case NewLineHandling.None:
705 *ptr2 = (byte)num;
706 ptr2++;
707 break;
708 }
709 break;
710 default:
711 if (XmlCharType.IsSurrogate(num))
712 {
714 pSrc += 2;
715 }
716 else if (num <= 127 || num >= 65534)
717 {
719 pSrc++;
720 }
721 else
722 {
724 pSrc++;
725 }
726 continue;
727 }
728 pSrc++;
729 }
730 _bufPos = (int)(ptr2 - ptr);
732 _contentPos = 0;
733 }
734 }
unsafe byte * WriteNewLine(byte *pDst)
static unsafe byte * AmpEntity(byte *pDst)
static unsafe byte * CarriageReturnEntity(byte *pDst)
unsafe byte * InvalidXmlChar(int ch, byte *pDst, bool entitize)
static unsafe byte * LtEntity(byte *pDst)
static unsafe byte * GtEntity(byte *pDst)
static unsafe byte * EncodeMultibyteUTF8(int ch, byte *pDst)
static unsafe byte * EncodeSurrogate(char *pSrc, char *pSrcEnd, byte *pDst)

References System.Xml.XmlUtf8RawTextWriter._bufBytes, System.Xml.XmlUtf8RawTextWriter._bufLen, System.Xml.XmlUtf8RawTextWriter._bufPos, System.Xml.XmlUtf8RawTextWriter._contentPos, System.Xml.XmlUtf8RawTextWriter._newLineHandling, System.Xml.XmlUtf8RawTextWriter._textPos, System.Xml.XmlUtf8RawTextWriter.AmpEntity(), System.Xml.XmlUtf8RawTextWriter.CarriageReturnEntity(), System.Xml.Dictionary, System.Xml.XmlUtf8RawTextWriter.EncodeMultibyteUTF8(), System.Xml.XmlUtf8RawTextWriter.EncodeSurrogate(), System.Xml.XmlUtf8RawTextWriter.FlushBuffer(), System.Xml.XmlUtf8RawTextWriter.GtEntity(), System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(), System.Xml.XmlCharType.IsAttributeValueChar(), System.Xml.XmlCharType.IsSurrogate(), System.Xml.XmlUtf8RawTextWriter.LtEntity(), and System.Xml.XmlUtf8RawTextWriter.WriteNewLine().

Referenced by System.Xml.HtmlUtf8RawTextWriter.WriteChars(), System.Xml.XmlUtf8RawTextWriter.WriteChars(), System.Xml.HtmlUtf8RawTextWriter.WriteHtmlElementTextBlock(), System.Xml.XmlUtf8RawTextWriter.WriteString(), and System.Xml.XmlUtf8RawTextWriter.WriteWhitespace().