Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CharEntityEncoderFallbackBuffer.cs
Go to the documentation of this file.
2using System.Text;
3
4namespace System.Xml;
5
7{
9
10 private string _charEntity = string.Empty;
11
12 private int _charEntityIndex = -1;
13
14 public override int Remaining
15 {
16 get
17 {
18 if (_charEntityIndex == -1)
19 {
20 return 0;
21 }
23 }
24 }
25
27 {
28 _parent = parent;
29 }
30
31 public override bool Fallback(char charUnknown, int index)
32 {
33 if (_charEntityIndex >= 0)
34 {
36 }
38 {
43 handler.AppendLiteral("&#x");
44 handler.AppendFormatted((int)charUnknown, "X");
45 handler.AppendLiteral(";");
46 _charEntity = string.Create(provider, initialBuffer, ref handler);
48 return true;
49 }
52 return false;
53 }
54
82
83 public override char GetNextChar()
84 {
85 if (_charEntityIndex == _charEntity.Length)
86 {
88 }
89 if (_charEntityIndex == -1)
90 {
91 return '\0';
92 }
94 }
95
96 public override bool MovePrevious()
97 {
98 if (_charEntityIndex == -1)
99 {
100 return false;
101 }
102 if (_charEntityIndex > 0)
103 {
105 return true;
106 }
107 return false;
108 }
109
110 public override void Reset()
111 {
112 _charEntityIndex = -1;
113 }
114
119}
override EncoderFallbackBuffer CreateFallbackBuffer()
bool Fallback(char charUnknown, int index)
override bool Fallback(char charUnknown, int index)
CharEntityEncoderFallbackBuffer(CharEntityEncoderFallback parent)
override bool Fallback(char charUnknownHigh, char charUnknownLow, int index)
int SurrogateCharToUtf32(char highSurrogate, char lowSurrogate)
static int CombineSurrogateChar(int lowChar, int highChar)
static Exception CreateInvalidSurrogatePairException(char low, char hi)