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

◆ RawTextNoFlush() [1/2]

unsafe int System.Xml.XmlUtf8RawTextWriter.RawTextNoFlush ( char * pSrcBegin,
char * pSrcEnd )
inlineprotectedinherited

Definition at line 2231 of file XmlUtf8RawTextWriter.cs.

2232 {
2233 fixed (byte* ptr = _bufBytes)
2234 {
2235 byte* ptr2 = ptr + _bufPos;
2236 char* ptr3 = pSrcBegin;
2237 int num = 0;
2238 while (true)
2239 {
2240 byte* ptr4 = ptr2 + (pSrcEnd - ptr3);
2241 if (ptr4 > ptr + _bufLen)
2242 {
2243 ptr4 = ptr + _bufLen;
2244 }
2245 for (; ptr2 < ptr4; ptr2++)
2246 {
2247 if ((num = *ptr3) > 127)
2248 {
2249 break;
2250 }
2251 ptr3++;
2252 *ptr2 = (byte)num;
2253 }
2254 if (ptr3 >= pSrcEnd)
2255 {
2256 break;
2257 }
2258 if (ptr2 >= ptr4)
2259 {
2260 _bufPos = (int)(ptr2 - ptr);
2261 return (int)(ptr3 - pSrcBegin);
2262 }
2263 if (XmlCharType.IsSurrogate(num))
2264 {
2266 ptr3 += 2;
2267 }
2268 else if (num <= 127 || num >= 65534)
2269 {
2271 ptr3++;
2272 }
2273 else
2274 {
2276 ptr3++;
2277 }
2278 }
2279 _bufPos = (int)(ptr2 - ptr);
2280 }
2281 return -1;
2282 }
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.InvalidXmlChar(), and System.Xml.XmlCharType.IsSurrogate().

Referenced by System.Xml.XmlUtf8RawTextWriter._RawTextAsync(), System.Xml.XmlUtf8RawTextWriter.RawTextAsync(), System.Xml.XmlUtf8RawTextWriter.RawTextAsync(), and System.Xml.XmlUtf8RawTextWriter.RawTextNoFlush().