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

◆ ParseTime()

bool System.Xml.Schema.XsdDateTime.Parser.ParseTime ( ref int start)
inlineprivate

Definition at line 186 of file XsdDateTime.cs.

187 {
189 {
191 if (ParseChar(start, '.'))
192 {
193 fraction = 0;
194 int num = 0;
195 int num2 = 0;
196 while (++start < _length)
197 {
198 int num3 = _text[start] - 48;
199 if (9u < (uint)num3)
200 {
201 break;
202 }
203 if (num < 7)
204 {
205 fraction = fraction * 10 + num3;
206 }
207 else if (num == 7)
208 {
209 if (5 < num3)
210 {
211 num2 = 1;
212 }
213 else if (num3 == 5)
214 {
215 num2 = -1;
216 }
217 }
218 else if (num2 < 0 && num3 != 0)
219 {
220 num2 = 1;
221 }
222 num++;
223 }
224 if (num < 7)
225 {
226 if (num == 0)
227 {
228 return false;
229 }
230 fraction *= s_power10[7 - num];
231 }
232 else
233 {
234 if (num2 < 0)
235 {
236 num2 = fraction & 1;
237 }
238 fraction += num2;
239 }
240 }
241 return true;
242 }
243 hour = 0;
244 return false;
245 }
bool ParseChar(int start, char ch)
static readonly int[] s_power10
bool Parse2Dig(int start, ref int num)
static readonly int s_lzHH_mm_
static readonly int s_lzHH_mm
static readonly int s_lzHH
static readonly int s_lzHH_mm_ss
static readonly int s_lzHH_

References System.Xml.Schema.XsdDateTime.Parser._length, System.Xml.Schema.XsdDateTime.Parser._text, System.Xml.Dictionary, System.Xml.Schema.XsdDateTime.Parser.fraction, System.Xml.Schema.XsdDateTime.Parser.hour, System.Xml.Schema.XsdDateTime.Parser.minute, System.Xml.Schema.XsdDateTime.Parser.Parse2Dig(), System.Xml.Schema.XsdDateTime.Parser.ParseChar(), System.Xml.Schema.XsdDateTime.s_lzHH, System.Xml.Schema.XsdDateTime.s_lzHH_, System.Xml.Schema.XsdDateTime.s_lzHH_mm, System.Xml.Schema.XsdDateTime.s_lzHH_mm_, System.Xml.Schema.XsdDateTime.s_lzHH_mm_ss, System.Xml.Schema.XsdDateTime.Parser.s_power10, System.Xml.Schema.XsdDateTime.Parser.second, and System.start.

Referenced by System.Xml.Schema.XsdDateTime.Parser.ParseTimeAndWhitespace(), and System.Xml.Schema.XsdDateTime.Parser.ParseTimeAndZoneAndWhitespace().