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

◆ RawText() [1/2]

unsafe void System.Xml.XmlUtf8RawTextWriter.RawText ( char * pSrcBegin,
char * pSrcEnd )
inlineprotectedinherited

Definition at line 744 of file XmlUtf8RawTextWriter.cs.

745 {
746 fixed (byte* ptr = _bufBytes)
747 {
748 byte* ptr2 = ptr + _bufPos;
749 char* ptr3 = pSrcBegin;
750 int num = 0;
751 while (true)
752 {
753 byte* ptr4 = ptr2 + (pSrcEnd - ptr3);
754 if (ptr4 > ptr + _bufLen)
755 {
756 ptr4 = ptr + _bufLen;
757 }
758 for (; ptr2 < ptr4; ptr2++)
759 {
760 if ((num = *ptr3) > 127)
761 {
762 break;
763 }
764 ptr3++;
765 *ptr2 = (byte)num;
766 }
767 if (ptr3 >= pSrcEnd)
768 {
769 break;
770 }
771 if (ptr2 >= ptr4)
772 {
773 _bufPos = (int)(ptr2 - ptr);
774 FlushBuffer();
775 ptr2 = ptr + 1;
776 }
777 else if (XmlCharType.IsSurrogate(num))
778 {
780 ptr3 += 2;
781 }
782 else if (num <= 127 || num >= 65534)
783 {
785 ptr3++;
786 }
787 else
788 {
790 ptr3++;
791 }
792 }
793 _bufPos = (int)(ptr2 - ptr);
794 }
795 }
unsafe byte * InvalidXmlChar(int ch, byte *pDst, bool entitize)
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.Dictionary, System.Xml.XmlUtf8RawTextWriter.EncodeMultibyteUTF8(), System.Xml.XmlUtf8RawTextWriter.EncodeSurrogate(), System.Xml.XmlUtf8RawTextWriter.FlushBuffer(), System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(), and System.Xml.XmlCharType.IsSurrogate().