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

◆ CreateFormat()

static TokenInfo System.Xml.Xsl.Runtime.TokenInfo.CreateFormat ( string formatString,
int startIdx,
int tokLen )
inlinestatic

Definition at line 26 of file TokenInfo.cs.

27 {
31 bool flag = false;
32 char c = formatString[startIdx];
33 switch (c)
34 {
35 default:
36 if (CharUtil.IsDecimalDigitOne(c))
37 {
38 break;
39 }
40 if (CharUtil.IsDecimalDigitOne((char)(c + 1)))
41 {
42 int num = startIdx;
43 do
44 {
45 tokenInfo.length++;
46 }
47 while (--tokLen > 0 && c == formatString[++num]);
48 if (formatString[num] == (c = (char)(c + 1)))
49 {
50 break;
51 }
52 }
53 flag = true;
54 break;
55 case '1':
56 case 'A':
57 case 'I':
58 case 'a':
59 case 'i':
60 break;
61 }
62 if (tokLen != 1)
63 {
64 flag = true;
65 }
66 if (flag)
67 {
70 }
71 else
72 {
74 }
75 return tokenInfo;
76 }

References System.Xml.Xsl.Runtime.TokenInfo.TokenInfo(), System.Xml.Dictionary, System.Xml.Xsl.Runtime.TokenInfo.formatString, System.Xml.Xsl.Runtime.CharUtil.IsDecimalDigitOne(), and System.Xml.Xsl.Runtime.TokenInfo.startIdx.

Referenced by System.Xml.Xsl.Runtime.NumberFormatter.NumberFormatter().