Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DecoderReplacementFallbackBuffer.cs
Go to the documentation of this file.
1namespace System.Text;
2
4{
5 private readonly string _strDefault;
6
7 private int _fallbackCount = -1;
8
9 private int _fallbackIndex = -1;
10
11 public override int Remaining
12 {
13 get
14 {
15 if (_fallbackCount >= 0)
16 {
17 return _fallbackCount;
18 }
19 return 0;
20 }
21 }
22
27
28 public override bool Fallback(byte[] bytesUnknown, int index)
29 {
30 if (_fallbackCount >= 1)
31 {
33 }
34 if (_strDefault.Length == 0)
35 {
36 return false;
37 }
39 _fallbackIndex = -1;
40 return true;
41 }
42
43 public override char GetNextChar()
44 {
47 if (_fallbackCount < 0)
48 {
49 return '\0';
50 }
51 if (_fallbackCount == int.MaxValue)
52 {
53 _fallbackCount = -1;
54 return '\0';
55 }
57 }
58
59 public override bool MovePrevious()
60 {
61 if (_fallbackCount >= -1 && _fallbackIndex >= 0)
62 {
65 return true;
66 }
67 return false;
68 }
69
70 public unsafe override void Reset()
71 {
72 _fallbackCount = -1;
73 _fallbackIndex = -1;
74 byteStart = null;
75 }
76
77 internal unsafe override int InternalFallback(byte[] bytes, byte* pBytes)
78 {
79 return _strDefault.Length;
80 }
81}
static void ThrowLastBytesRecursive(byte[] bytesUnknown)
unsafe override int InternalFallback(byte[] bytes, byte *pBytes)
DecoderReplacementFallbackBuffer(DecoderReplacementFallback fallback)
override bool Fallback(byte[] bytesUnknown, int index)