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

◆ WriteAttributeTextBlockNoFlush() [1/3]

unsafe int System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockNoFlush ( char * pSrc,
char * pSrcEnd )
inlineprotectedinherited

Definition at line 1834 of file XmlUtf8RawTextWriter.cs.

1835 {
1836 char* ptr = pSrc;
1837 fixed (byte* ptr2 = _bufBytes)
1838 {
1839 byte* ptr3 = ptr2 + _bufPos;
1840 int num = 0;
1841 while (true)
1842 {
1843 byte* ptr4 = ptr3 + (pSrcEnd - pSrc);
1844 if (ptr4 > ptr2 + _bufLen)
1845 {
1846 ptr4 = ptr2 + _bufLen;
1847 }
1848 while (ptr3 < ptr4 && XmlCharType.IsAttributeValueChar((char)(num = *pSrc)) && num <= 127)
1849 {
1850 *ptr3 = (byte)num;
1851 ptr3++;
1852 pSrc++;
1853 }
1854 if (pSrc >= pSrcEnd)
1855 {
1856 break;
1857 }
1858 if (ptr3 >= ptr4)
1859 {
1860 _bufPos = (int)(ptr3 - ptr2);
1861 return (int)(pSrc - ptr);
1862 }
1863 switch (num)
1864 {
1865 case 38:
1866 ptr3 = AmpEntity(ptr3);
1867 break;
1868 case 60:
1869 ptr3 = LtEntity(ptr3);
1870 break;
1871 case 62:
1872 ptr3 = GtEntity(ptr3);
1873 break;
1874 case 34:
1876 break;
1877 case 39:
1878 *ptr3 = (byte)num;
1879 ptr3++;
1880 break;
1881 case 9:
1882 if (_newLineHandling == NewLineHandling.None)
1883 {
1884 *ptr3 = (byte)num;
1885 ptr3++;
1886 }
1887 else
1888 {
1889 ptr3 = TabEntity(ptr3);
1890 }
1891 break;
1892 case 13:
1893 if (_newLineHandling == NewLineHandling.None)
1894 {
1895 *ptr3 = (byte)num;
1896 ptr3++;
1897 }
1898 else
1899 {
1901 }
1902 break;
1903 case 10:
1904 if (_newLineHandling == NewLineHandling.None)
1905 {
1906 *ptr3 = (byte)num;
1907 ptr3++;
1908 }
1909 else
1910 {
1912 }
1913 break;
1914 default:
1915 if (XmlCharType.IsSurrogate(num))
1916 {
1918 pSrc += 2;
1919 }
1920 else if (num <= 127 || num >= 65534)
1921 {
1923 pSrc++;
1924 }
1925 else
1926 {
1928 pSrc++;
1929 }
1930 continue;
1931 }
1932 pSrc++;
1933 }
1934 _bufPos = (int)(ptr3 - ptr2);
1935 }
1936 return -1;
1937 }
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 * QuoteEntity(byte *pDst)
static unsafe byte * TabEntity(byte *pDst)
static unsafe byte * LineFeedEntity(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._newLineHandling, System.Xml.XmlUtf8RawTextWriter.AmpEntity(), System.Xml.XmlUtf8RawTextWriter.CarriageReturnEntity(), System.Xml.Dictionary, System.Xml.XmlUtf8RawTextWriter.EncodeMultibyteUTF8(), System.Xml.XmlUtf8RawTextWriter.EncodeSurrogate(), System.Xml.XmlUtf8RawTextWriter.GtEntity(), System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(), System.Xml.XmlCharType.IsAttributeValueChar(), System.Xml.XmlCharType.IsSurrogate(), System.Xml.XmlUtf8RawTextWriter.LineFeedEntity(), System.Xml.XmlUtf8RawTextWriter.LtEntity(), System.Xml.XmlUtf8RawTextWriter.QuoteEntity(), and System.Xml.XmlUtf8RawTextWriter.TabEntity().

Referenced by System.Xml.XmlUtf8RawTextWriter._WriteAttributeTextBlockAsync(), System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockAsync(), System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockAsync(), System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockNoFlush(), and System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlockNoFlush().