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

◆ WriteUriAttributeText()

unsafe void System.Xml.HtmlUtf8RawTextWriter.WriteUriAttributeText ( char * pSrc,
char * pSrcEnd )
inlineprivate

Definition at line 399 of file HtmlUtf8RawTextWriter.cs.

400 {
402 {
403 if (pSrcEnd - pSrc > 0 && *pSrc != '{')
404 {
406 }
407 _endsWithAmpersand = false;
408 }
409 fixed (byte* ptr = _bufBytes)
410 {
411 byte* ptr2 = ptr + _bufPos;
412 char c = '\0';
413 while (true)
414 {
415 byte* ptr3 = ptr2 + (pSrcEnd - pSrc);
416 if (ptr3 > ptr + _bufLen)
417 {
418 ptr3 = ptr + _bufLen;
419 }
420 while (ptr2 < ptr3 && XmlCharType.IsAttributeValueChar(c = *pSrc) && c < '\u0080')
421 {
422 *(ptr2++) = (byte)c;
423 pSrc++;
424 }
425 if (pSrc >= pSrcEnd)
426 {
427 break;
428 }
429 if (ptr2 >= ptr3)
430 {
431 _bufPos = (int)(ptr2 - ptr);
432 FlushBuffer();
433 ptr2 = ptr + 1;
434 continue;
435 }
436 switch (c)
437 {
438 case '&':
439 if (pSrc + 1 == pSrcEnd)
440 {
441 _endsWithAmpersand = true;
442 }
443 else if (pSrc[1] != '{')
444 {
445 ptr2 = XmlUtf8RawTextWriter.AmpEntity(ptr2);
446 break;
447 }
448 *(ptr2++) = (byte)c;
449 break;
450 case '"':
451 ptr2 = XmlUtf8RawTextWriter.QuoteEntity(ptr2);
452 break;
453 case '\t':
454 case '\'':
455 case '<':
456 case '>':
457 *(ptr2++) = (byte)c;
458 break;
459 case '\r':
460 ptr2 = XmlUtf8RawTextWriter.CarriageReturnEntity(ptr2);
461 break;
462 case '\n':
463 ptr2 = XmlUtf8RawTextWriter.LineFeedEntity(ptr2);
464 break;
465 default:
467 {
468 byte* ptr5 = ptr4;
469 byte* pDst = ptr5;
471 for (; ptr5 < pDst; ptr5++)
472 {
473 *(ptr2++) = 37;
474 *(ptr2++) = (byte)System.HexConverter.ToCharUpper(*ptr5 >> 4);
475 *(ptr2++) = (byte)System.HexConverter.ToCharUpper(*ptr5);
476 }
477 }
478 continue;
479 }
480 pSrc++;
481 }
482 _bufPos = (int)(ptr2 - ptr);
483 }
484 }
static char ToCharUpper(int value)
XmlUtf8RawTextWriter(XmlWriterSettings settings)

References System.Xml.XmlUtf8RawTextWriter._bufBytes, System.Xml.XmlUtf8RawTextWriter._bufLen, System.Xml.XmlUtf8RawTextWriter._bufPos, System.Xml.HtmlUtf8RawTextWriter._endsWithAmpersand, System.Xml.HtmlUtf8RawTextWriter._uriEscapingBuffer, System.Xml.XmlUtf8RawTextWriter.AmpEntity(), System.Xml.XmlUtf8RawTextWriter.CarriageReturnEntity(), System.Xml.XmlUtf8RawTextWriter.CharToUTF8(), System.Xml.Dictionary, System.Xml.XmlUtf8RawTextWriter.FlushBuffer(), System.Xml.XmlCharType.IsAttributeValueChar(), System.Xml.XmlUtf8RawTextWriter.LineFeedEntity(), System.Xml.HtmlUtf8RawTextWriter.OutputRestAmps(), System.Xml.XmlUtf8RawTextWriter.QuoteEntity(), and System.HexConverter.ToCharUpper().

Referenced by System.Xml.HtmlUtf8RawTextWriter.WriteHtmlAttributeTextBlock().