terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
FormatProvider.cs
Go to the documentation of this file.
1using System;
3using System.Text;
4
6{
7 // Token: 0x02000007 RID: 7
8 internal class FormatProvider
9 {
10 // Token: 0x0600002F RID: 47 RVA: 0x00002674 File Offset: 0x00000874
11 internal static void FormatBigInteger(ValueStringBuilder sb, int precision, int scale, bool sign, ReadOnlySpan<char> format, NumberFormatInfo numberFormatInfo, char[] digits, int startIndex)
12 {
13 int num = 1;
14 if (startIndex != 0)
15 {
16 return;
17 }
18 if (num == 0)
19 {
20 }
21 if (num == 0)
22 {
23 }
24 }
25
26 // Token: 0x02000008 RID: 8
27 private class Number
28 {
29 // Token: 0x06000030 RID: 48 RVA: 0x00002694 File Offset: 0x00000894
30 internal unsafe static void Int32ToDecChars(char* buffer, int index, uint value, int digits)
31 {
32 if (value == 0U)
33 {
34 return;
35 }
36 }
37
38 // Token: 0x06000031 RID: 49 RVA: 0x000026A8 File Offset: 0x000008A8
39 internal static char ParseFormatSpecifier(ReadOnlySpan<char> format, [Out] int digits)
40 {
41 /*
42An exception occurred when decompiling this method (06000031)
43
44ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Char System.Globalization.FormatProvider/Number::ParseFormatSpecifier(System.ReadOnlySpan`1<System.Char>,System.Int32)
45
46 ---> System.Exception: Basic block has to end with unconditional control flow.
47{
48 Block_2:
49 stfld:int32(int32::m_value, ldloc:int32[exp:int32&](digits), ldloc:int64[exp:int32](var_5_25))
50}
51
52 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
53 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
54 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
55 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
56 --- End of inner exception stack trace ---
57 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
58 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
59*/;
60 }
61
62 // Token: 0x06000032 RID: 50 RVA: 0x000026E8 File Offset: 0x000008E8
66
67 // Token: 0x06000033 RID: 51 RVA: 0x0000289C File Offset: 0x00000A9C
69 {
70 int num = 1;
71 bool sign = number.sign;
72 if (num == 0)
73 {
74 }
75 int num2 = 184;
76 long num3 = 0L;
77 int[] currencyGroupSizes = info.CurrencyGroupSizes;
78 string currencyGroupSeparator = info.currencyGroupSeparator;
79 string currencyDecimalSeparator = info.currencyDecimalSeparator;
80 if (num2 == 0)
81 {
82 }
83 FormatProvider.Number.FormatFixed(sb, number, (int)num3, nMaxDigits, info, currencyGroupSizes, currencyDecimalSeparator, currencyGroupSeparator);
84 }
85
86 // Token: 0x06000034 RID: 52 RVA: 0x00002978 File Offset: 0x00000B78
87 private unsafe static int wcslen(char* s)
88 {
89 }
90
91 // Token: 0x06000035 RID: 53 RVA: 0x00002988 File Offset: 0x00000B88
93 {
94 int num = 1;
95 int scale = number.scale;
96 char* overrideDigits = number.overrideDigits;
97 if (num == 0)
98 {
99 }
100 }
101
102 // Token: 0x06000036 RID: 54 RVA: 0x00002A4C File Offset: 0x00000C4C
104 {
105 int num = 1;
106 bool sign = number.sign;
107 if (num == 0)
108 {
109 }
110 if (sign)
111 {
112 return;
113 }
114 long num2 = 0L;
115 int[] numberGroupSizes = info.NumberGroupSizes;
116 string numberDecimalSeparator = info.numberDecimalSeparator;
117 string numberGroupSeparator = info.numberGroupSeparator;
118 FormatProvider.Number.FormatFixed(sb, number, (int)num2, nMaxDigits, info, numberGroupSizes, numberDecimalSeparator, numberGroupSeparator);
119 }
120
121 // Token: 0x06000037 RID: 55 RVA: 0x00002B08 File Offset: 0x00000D08
123 {
124 char* overrideDigits = number.overrideDigits;
125 int length = sb._chars._length;
126 Span<char> chars = sb._chars;
127 }
128
129 // Token: 0x06000038 RID: 56 RVA: 0x00002BC4 File Offset: 0x00000DC4
130 private static void FormatExponent(ValueStringBuilder sb, NumberFormatInfo info, int value, char expChar, int minDigits, bool positiveSign)
131 {
132 int length = sb._chars._length;
134 }
135
136 // Token: 0x06000039 RID: 57 RVA: 0x00002CC0 File Offset: 0x00000EC0
138 {
139 int scale = number.scale;
140 }
141
142 // Token: 0x0600003A RID: 58 RVA: 0x00002DAC File Offset: 0x00000FAC
144 {
145 int num = 1;
146 bool sign = number.sign;
147 if (num == 0)
148 {
149 }
150 int num2 = 196;
151 long num3 = 0L;
152 int[] percentGroupSizes = info.PercentGroupSizes;
153 string percentDecimalSeparator = info.percentDecimalSeparator;
154 string percentGroupSeparator = info.percentGroupSeparator;
155 if (num2 == 0)
156 {
157 }
158 FormatProvider.Number.FormatFixed(sb, number, (int)num3, nMaxDigits, info, percentGroupSizes, percentDecimalSeparator, percentGroupSeparator);
159 }
160
161 // Token: 0x0600003B RID: 59 RVA: 0x00002E88 File Offset: 0x00001088
163 {
164 char* overrideDigits = number.overrideDigits;
165 }
166
167 // Token: 0x0600003C RID: 60 RVA: 0x00002EC8 File Offset: 0x000010C8
169 {
170 if (section != 0)
171 {
172 return;
173 }
174 }
175
176 // Token: 0x0600003D RID: 61 RVA: 0x00002EDC File Offset: 0x000010DC
178 {
179 char* overrideDigits = number.overrideDigits;
180 bool sign = number.sign;
181 }
182
183 // Token: 0x0600003E RID: 62 RVA: 0x00003164 File Offset: 0x00001364
184 // Note: this type is marked as 'beforefieldinit'.
185 static Number()
186 {
187 if (("$#" == null || "$#" != null) && ("#$" == null || "#$" != null) && ("$ #" == null || "$ #" != null) && ("# $" == null || "# $" != null) && ("($#)" == null || "($#)" != null) && ("-$#" == null || "-$#" != null) && ("$-#" == null || "$-#" != null) && ("$#-" == null || "$#-" != null) && ("(#$)" == null || "(#$)" != null) && ("-#$" == null || "-#$" != null) && ("#-$" == null || "#-$" != null) && ("#$-" == null || "#$-" != null) && ("-# $" == null || "-# $" != null) && ("-$ #" == null || "-$ #" != null) && ("# $-" == null || "# $-" != null) && ("$ #-" == null || "$ #-" != null) && ("$ -#" == null || "$ -#" != null) && ("#- $" == null || "#- $" != null) && ("($ #)" == null || "($ #)" != null) && ("(# $)" == null || "(# $)" != null) && ("# %" == null || "# %" != null) && ("#%" == null || "#%" != null) && ("%#" == null || "%#" != null) && ("% #" == null || "% #" != null) && ("-# %" == null || "-# %" != null) && ("-#%" == null || "-#%" != null) && ("-%#" == null || "-%#" != null) && ("%-#" == null || "%-#" != null) && ("%#-" == null || "%#-" != null) && ("#-%" == null || "#-%" != null) && ("#%-" == null || "#%-" != null) && ("-% #" == null || "-% #" != null) && ("# %-" == null || "# %-" != null) && ("% #-" == null || "% #-" != null) && ("% -#" == null || "% -#" != null) && ("#- %" == null || "#- %" != null) && ("(#)" == null || "(#)" != null) && ("-#" == null || "-#" != null) && ("- #" == null || "- #" != null) && ("#-" == null || "#-" != null) && ("# -" == null || "# -" != null))
188 {
189 return;
190 }
191 throw new ArrayTypeMismatchException();
192 }
193
194 // Token: 0x04000010 RID: 16
195 private static string[] s_posCurrencyFormats;
196
197 // Token: 0x04000011 RID: 17
198 private static string[] s_negCurrencyFormats;
199
200 // Token: 0x04000012 RID: 18
201 private static string[] s_posPercentFormats;
202
203 // Token: 0x04000013 RID: 19
204 private static string[] s_negPercentFormats;
205
206 // Token: 0x04000014 RID: 20
207 private static string[] s_negNumberFormats;
208
209 // Token: 0x04000015 RID: 21
210 private static string s_posNumberFormat;
211
212 // Token: 0x02000009 RID: 9
213 internal struct NumberBuffer
214 {
215 // Token: 0x17000002 RID: 2
216 // (get) Token: 0x0600003F RID: 63 RVA: 0x0000341B File Offset: 0x0000161B
217 public unsafe char* digits
218 {
219 get
220 {
221 return null;
222 }
223 }
224
225 // Token: 0x04000016 RID: 22
226 public int precision;
227
228 // Token: 0x04000017 RID: 23
229 public int scale;
230
231 // Token: 0x04000018 RID: 24
232 public bool sign;
233
234 // Token: 0x04000019 RID: 25
235 public unsafe char* overrideDigits;
236 }
237 }
238 }
239}
class f__AnonymousType0<< Count > j__TPar
static unsafe void FormatFixed(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, int[] groupDigits, string sDecimal, string sGroup)
static unsafe void NumberToStringFormat(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, ReadOnlySpan< char > format, NumberFormatInfo info)
static int FindSection(ReadOnlySpan< char > format, int section)
static void FormatCurrency(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info)
static unsafe void Int32ToDecChars(char *buffer, int index, uint value, int digits)
static void FormatPercent(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info)
static unsafe void FormatScientific(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar)
static void FormatNumber(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info)
static void FormatGeneral(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar, bool bSuppressScientific)
static void FormatExponent(ValueStringBuilder sb, NumberFormatInfo info, int value, char expChar, int minDigits, bool positiveSign)
static void NumberToString(ValueStringBuilder sb, FormatProvider.Number.NumberBuffer number, char format, int nMaxDigits, NumberFormatInfo info, bool isDecimal)
static unsafe void RoundNumber(FormatProvider.Number.NumberBuffer number, int pos)
static char ParseFormatSpecifier(ReadOnlySpan< char > format, [Out] int digits)
static void FormatBigInteger(ValueStringBuilder sb, int precision, int scale, bool sign, ReadOnlySpan< char > format, NumberFormatInfo numberFormatInfo, char[] digits, int startIndex)
readonly int _length
Definition Span.cs:240