42 for (; i !=
source.Length; i++)
45 if (b != 32 && b != 9)
72 switch (componentParseResult)
81 Separators |= (uint)componentParseResult << 24;
83 switch (componentParseResult)
92 Separators |= (uint)componentParseResult << 16;
94 switch (componentParseResult)
103 Separators |= (uint)componentParseResult << 8;
105 switch (componentParseResult)
130 if (srcIndex ==
source.Length)
135 byte b =
source[srcIndex];
136 if (b == 58 || (b == 46 && neverParseAsFraction))
144 srcIndex += bytesConsumed;
159 srcIndex += bytesConsumed2;
169 0, 31, 59, 90, 120, 151, 181, 212, 243, 273,
175 0, 31, 60, 91, 121, 152, 182, 213, 244, 274,
181 if (standardFormat != 0 && standardFormat !=
'G' && standardFormat !=
'l')
188 if (num == 1163219540)
194 if (
source.Length > 4 && num == 1397506374 && (
source[4] & -33) == 69)
208 switch (standardFormat)
217 value = dateTimeOffset.DateTime;
227 value = dateTimeOffset2.DateTime;
241 value = value2.LocalDateTime;
244 value = value2.UtcDateTime;
247 value = value2.DateTime;
267 return standardFormat
switch
299 if (b != 43 && b != 45)
305 uint num = (uint)(
source[21] - 48);
306 uint num2 = (uint)(
source[22] - 48);
307 if (num > 9 || num2 > 9)
313 int offsetHours = (int)(num * 10 + num2);
320 uint num3 = (uint)(
source[24] - 48);
321 uint num4 = (uint)(
source[25] - 48);
322 if (num3 > 9 || num4 > 9)
328 int offsetMinutes = (int)(num3 * 10 + num4);
348 uint num = (uint)(
source[0] - 48);
349 uint num2 = (uint)(
source[1] - 48);
350 if (num > 9 || num2 > 9)
357 int month = (int)(num * 10 + num2);
365 uint num3 = (uint)(
source[3] - 48);
366 uint num4 = (uint)(
source[4] - 48);
367 if (num3 > 9 || num4 > 9)
374 int day = (int)(num3 * 10 + num4);
382 uint num5 = (uint)(
source[6] - 48);
383 uint num6 = (uint)(
source[7] - 48);
384 uint num7 = (uint)(
source[8] - 48);
385 uint num8 = (uint)(
source[9] - 48);
386 if (num5 > 9 || num6 > 9 || num7 > 9 || num8 > 9)
393 int year = (int)(num5 * 1000 + num6 * 100 + num7 * 10 + num8);
401 uint num9 = (uint)(
source[11] - 48);
402 uint num10 = (uint)(
source[12] - 48);
403 if (num9 > 9 || num10 > 9)
410 int hour = (int)(num9 * 10 + num10);
418 uint num11 = (uint)(
source[14] - 48);
419 uint num12 = (uint)(
source[15] - 48);
420 if (num11 > 9 || num12 > 9)
427 int minute = (int)(num11 * 10 + num12);
435 uint num13 = (uint)(
source[17] - 48);
436 uint num14 = (uint)(
source[18] - 48);
437 if (num13 > 9 || num14 > 9)
444 int second = (int)(num13 * 10 + num14);
453 value = valueAsOffset.DateTime;
459 if ((uint)offsetHours > 14u)
464 if ((uint)offsetMinutes > 59u)
469 if (offsetHours == 14 && offsetMinutes != 0)
474 long num = ((long)offsetHours * 3600
L + (
long)offsetMinutes * 60
L) * 10000000;
491 private static bool TryCreateDateTimeOffset(
int year,
int month,
int day,
int hour,
int minute,
int second,
int fraction,
bool offsetNegative,
int offsetHours,
int offsetMinutes, out
DateTimeOffset value)
532 if ((uint)(month - 1) >= 12u)
537 uint num = (uint)(day - 1);
543 if ((uint)hour > 23u)
548 if ((uint)minute > 59u)
553 if ((uint)second > 59u)
560 int num3 = num2 * 365 + num2 / 4 - num2 / 100 + num2 / 400 +
array[month - 1] + day - 1;
561 long num4 = num3 * 864000000000
L;
562 int num5 = hour * 3600 + minute * 60 + second;
563 num4 += (long)num5 * 10000000
L;
578 uint num = (uint)(
source[0] - 48);
579 uint num2 = (uint)(
source[1] - 48);
580 uint num3 = (uint)(
source[2] - 48);
581 uint num4 = (uint)(
source[3] - 48);
582 if (num > 9 || num2 > 9 || num3 > 9 || num4 > 9)
589 int year = (int)(num * 1000 + num2 * 100 + num3 * 10 + num4);
597 uint num5 = (uint)(
source[5] - 48);
598 uint num6 = (uint)(
source[6] - 48);
599 if (num5 > 9 || num6 > 9)
606 int month = (int)(num5 * 10 + num6);
614 uint num7 = (uint)(
source[8] - 48);
615 uint num8 = (uint)(
source[9] - 48);
616 if (num7 > 9 || num8 > 9)
623 int day = (int)(num7 * 10 + num8);
631 uint num9 = (uint)(
source[11] - 48);
632 uint num10 = (uint)(
source[12] - 48);
633 if (num9 > 9 || num10 > 9)
640 int hour = (int)(num9 * 10 + num10);
648 uint num11 = (uint)(
source[14] - 48);
649 uint num12 = (uint)(
source[15] - 48);
650 if (num11 > 9 || num12 > 9)
657 int minute = (int)(num11 * 10 + num12);
665 uint num13 = (uint)(
source[17] - 48);
666 uint num14 = (uint)(
source[18] - 48);
667 if (num13 > 9 || num14 > 9)
674 int second = (int)(num13 * 10 + num14);
682 uint num15 = (uint)(
source[20] - 48);
683 uint num16 = (uint)(
source[21] - 48);
684 uint num17 = (uint)(
source[22] - 48);
685 uint num18 = (uint)(
source[23] - 48);
686 uint num19 = (uint)(
source[24] - 48);
687 uint num20 = (uint)(
source[25] - 48);
688 uint num21 = (uint)(
source[26] - 48);
689 if (num15 > 9 || num16 > 9 || num17 > 9 || num18 > 9 || num19 > 9 || num20 > 9 || num21 > 9)
696 int fraction = (int)(num15 * 1000000 + num16 * 100000 + num17 * 10000 + num18 * 1000 + num19 * 100 + num20 * 10 + num21);
698 if (b != 90 && b != 43 && b != 45)
713 if (!
TryCreateDateTimeOffset(
year, month, day, hour, minute, second, fraction, offsetNegative:
false, 0, 0, out
value))
731 uint num22 = (uint)(
source[28] - 48);
732 uint num23 = (uint)(
source[29] - 48);
733 if (num22 > 9 || num23 > 9)
740 int offsetHours = (int)(num22 * 10 + num23);
748 uint num24 = (uint)(
source[31] - 48);
749 uint num25 = (uint)(
source[32] - 48);
750 if (num24 > 9 || num25 > 9)
757 int offsetMinutes = (int)(num24 * 10 + num25);
758 if (!
TryCreateDateTimeOffset(
year, month, day, hour, minute, second, fraction, b == 45, offsetHours, offsetMinutes, out
value))
778 uint num =
source[0] ^ caseFlipXorMask;
783 switch ((num << 24) | (num2 << 16) | (num3 << 8) | num4)
817 uint num5 = (uint)(
source[5] - 48);
818 uint num6 = (uint)(
source[6] - 48);
819 if (num5 > 9 || num6 > 9)
825 int day = (int)(num5 * 10 + num6);
832 uint num7 =
source[8] ^ caseFlipXorMask;
837 switch ((num7 << 24) | (num8 << 16) | (num9 << 8) | num10)
880 uint num11 = (uint)(
source[12] - 48);
881 uint num12 = (uint)(
source[13] - 48);
882 uint num13 = (uint)(
source[14] - 48);
883 uint num14 = (uint)(
source[15] - 48);
884 if (num11 > 9 || num12 > 9 || num13 > 9 || num14 > 9)
890 int year = (int)(num11 * 1000 + num12 * 100 + num13 * 10 + num14);
897 uint num15 = (uint)(
source[17] - 48);
898 uint num16 = (uint)(
source[18] - 48);
899 if (num15 > 9 || num16 > 9)
905 int hour = (int)(num15 * 10 + num16);
912 uint num17 = (uint)(
source[20] - 48);
913 uint num18 = (uint)(
source[21] - 48);
914 if (num17 > 9 || num18 > 9)
920 int minute = (int)(num17 * 10 + num18);
927 uint num19 = (uint)(
source[23] - 48);
928 uint num20 = (uint)(
source[24] - 48);
929 if (num19 > 9 || num20 > 9)
935 int second = (int)(num19 * 10 + num20);
937 uint num22 =
source[26] ^ caseFlipXorMask;
938 uint num23 =
source[27] ^ caseFlipXorMask;
939 uint num24 =
source[28] ^ caseFlipXorMask;
940 uint num25 = (num21 << 24) | (num22 << 16) | (num23 << 8) | num24;
941 if (num25 != 541543764)
947 if (!
TryCreateDateTimeOffset(
year, month, day, hour, minute, second, 0, offsetNegative:
false, 0, 0, out dateTimeOffset))
953 if (dayOfWeek != dateTimeOffset.DayOfWeek)
966 switch (standardFormat)
982 byte* digits = stackalloc
byte[31];
986 value =
default(decimal);
989 if (!textUsedExponentNotation && (standardFormat ==
'E' || standardFormat ==
'e'))
991 value =
default(decimal);
995 value =
default(decimal);
998 value =
default(decimal);
1007 byte* digits = stackalloc
byte[114];
1014 return TryParseAsSpecialFloatingPoint(
source,
float.PositiveInfinity,
float.NegativeInfinity,
float.NaN, out
value, out bytesConsumed);
1019 byte* digits = stackalloc
byte[769];
1026 return TryParseAsSpecialFloatingPoint(
source,
double.PositiveInfinity,
double.NegativeInfinity,
double.NaN, out
value, out bytesConsumed);
1032 switch (standardFormat)
1052 if (!textUsedExponentNotation && (standardFormat ==
'E' || standardFormat ==
'e'))
1063 int num2 =
source.Length;
1083 if (((
source[num] ^ 0x6E) & -33) == 0 && ((
source[num + 1] ^ 0x61) & -33) == 0 && ((
source[num + 2] ^ 0x6E) & -33) == 0)
1086 bytesConsumed = 3 + num;
1092 if ((num3 & -538976289) == 0)
1095 if ((num3 & -538976289) == 0)
1097 value = (flag ? negativeInfinity : positiveInfinity);
1098 bytesConsumed = 8 + num;
1113 switch (standardFormat)
1128 standardFormat =
'\0';
1134 if (
text.Length < 32)
1140 if (!
TryParseUInt32X(
text.Slice(0, 8), out var value2, out var bytesConsumed2) || bytesConsumed2 != 8)
1146 if (!
TryParseUInt16X(
text.Slice(8, 4), out var value3, out bytesConsumed2) || bytesConsumed2 != 4)
1152 if (!
TryParseUInt16X(
text.Slice(12, 4), out var value4, out bytesConsumed2) || bytesConsumed2 != 4)
1158 if (!
TryParseUInt16X(
text.Slice(16, 4), out var value5, out bytesConsumed2) || bytesConsumed2 != 4)
1164 if (!
TryParseUInt64X(
text.Slice(20), out var value6, out bytesConsumed2) || bytesConsumed2 != 12)
1171 value =
new Guid((
int)value2, (
short)value3, (
short)value4, (
byte)(value5 >> 8), (
byte)value5, (
byte)(value6 >> 40), (
byte)(value6 >> 32), (
byte)(value6 >> 24), (
byte)(value6 >> 16), (
byte)(value6 >> 8), (
byte)value6);
1177 int num = 36 + ((ends != 0) ? 2 : 0);
1186 if (
source[0] != (
byte)ends)
1201 if (bytesConsumed2 != 8)
1207 if (
source[bytesConsumed2] != 45)
1220 if (bytesConsumed2 != 4)
1226 if (
source[bytesConsumed2] != 45)
1239 if (bytesConsumed2 != 4)
1245 if (
source[bytesConsumed2] != 45)
1258 if (bytesConsumed2 != 4)
1264 if (
source[bytesConsumed2] != 45)
1277 if (bytesConsumed2 != 12)
1283 if (ends != 0 &&
source[bytesConsumed2] != (
byte)ends)
1289 bytesConsumed = num;
1290 value =
new Guid((
int)value2, (
short)value3, (
short)value4, (
byte)(value5 >> 8), (
byte)value5, (
byte)(value6 >> 40), (
byte)(value6 >> 32), (
byte)(value6 >> 24), (
byte)(value6 >> 16), (
byte)(value6 >> 8), (
byte)value6);
1294 [CLSCompliant(
false)]
1297 while (standardFormat != 0)
1299 switch (standardFormat | 0x20)
1312 standardFormat =
'\0';
1319 while (standardFormat != 0)
1321 switch (standardFormat | 0x20)
1334 standardFormat =
'\0';
1341 while (standardFormat != 0)
1343 switch (standardFormat | 0x20)
1356 standardFormat =
'\0';
1363 while (standardFormat != 0)
1365 switch (standardFormat | 0x20)
1378 standardFormat =
'\0';
1398 if ((uint)num2 >= (uint)
source.Length)
1404 else if (num3 == 43)
1407 if ((uint)num2 >= (uint)
source.Length)
1423 if ((uint)num2 >= (uint)
source.Length)
1439 bytesConsumed = num2;
1440 value = (sbyte)(num4 * num);
1445 if ((uint)num2 < (uint)
source.Length)
1451 num4 = 10 * num4 + num3 - 48;
1452 if ((uint)num2 < (uint)
source.Length)
1458 num4 = num4 * 10 + num3 - 48;
1495 if ((uint)num2 >= (uint)
source.Length)
1501 else if (num3 == 43)
1504 if ((uint)num2 >= (uint)
source.Length)
1520 if ((uint)num2 >= (uint)
source.Length)
1536 bytesConsumed = num2;
1542 if ((uint)num2 < (uint)
source.Length)
1548 num4 = 10 * num4 + num3 - 48;
1549 if ((uint)num2 < (uint)
source.Length)
1555 num4 = 10 * num4 + num3 - 48;
1556 if ((uint)num2 < (uint)
source.Length)
1562 num4 = 10 * num4 + num3 - 48;
1563 if ((uint)num2 < (uint)
source.Length)
1569 num4 = num4 * 10 + num3 - 48;
1610 if ((uint)num2 >= (uint)
source.Length)
1616 else if (num3 == 43)
1619 if ((uint)num2 >= (uint)
source.Length)
1635 if ((uint)num2 >= (uint)
source.Length)
1651 bytesConsumed = num2;
1657 if ((uint)num2 < (uint)
source.Length)
1663 num4 = 10 * num4 + num3 - 48;
1664 if ((uint)num2 < (uint)
source.Length)
1670 num4 = 10 * num4 + num3 - 48;
1671 if ((uint)num2 < (uint)
source.Length)
1677 num4 = 10 * num4 + num3 - 48;
1678 if ((uint)num2 < (uint)
source.Length)
1684 num4 = 10 * num4 + num3 - 48;
1685 if ((uint)num2 < (uint)
source.Length)
1691 num4 = 10 * num4 + num3 - 48;
1692 if ((uint)num2 < (uint)
source.Length)
1698 num4 = 10 * num4 + num3 - 48;
1699 if ((uint)num2 < (uint)
source.Length)
1705 num4 = 10 * num4 + num3 - 48;
1706 if ((uint)num2 < (uint)
source.Length)
1712 num4 = 10 * num4 + num3 - 48;
1713 if ((uint)num2 < (uint)
source.Length)
1719 if (num4 <= 214748364)
1721 num4 = num4 * 10 + num3 - 48;
1763 while ((uint)num2 < (uint)
source.Length)
1765 nuint num3 = (uint)(
source[num2] - 48);
1773 if ((
int)num3 == -3)
1777 else if ((
int)num3 != -5)
1784 int num5 = 19 + num2;
1786 if (
source.Length < num5)
1788 for (; (uint)num2 < (uint)
source.Length; num2++)
1790 nuint num6 = (uint)(
source[num2] - 48);
1795 num4 = num4 * 10 + num6;
1800 while ((uint)num2 < (uint)
source.Length)
1802 nuint num7 = (uint)(
source[num2] - 48);
1808 if (num4 < 922337203685477580
L)
1810 num4 = num4 * 10 + num7;
1813 if (num4 != 922337203685477580
L || (
int)num7 + (int)num > 7)
1817 num4 = 9223372036854775800uL + (ulong)num7;
1820 bytesConsumed = num2;
1821 value = (long)(num4 ^ (ulong)num) - num;
1847 if ((uint)num2 >= (uint)
source.Length)
1853 else if (num3 == 43)
1856 if ((uint)num2 >= (uint)
source.Length)
1870 if ((uint)num2 >= (uint)
source.Length)
1887 num4 = num4 * 10 + num3 - 48;
1888 if (num4 <= 127 + (-1 * num + 1) / 2)
1901 if ((uint)num2 < (uint)
source.Length &&
source[num2] == 48)
1922 if ((uint)num2 >= (uint)
source.Length)
1935 bytesConsumed = num2;
1936 value = (sbyte)(num4 * num);
1955 if ((uint)num2 >= (uint)
source.Length)
1961 else if (num3 == 43)
1964 if ((uint)num2 >= (uint)
source.Length)
1978 if ((uint)num2 >= (uint)
source.Length)
1995 num4 = num4 * 10 + num3 - 48;
1996 if (num4 <= 32767 + (-1 * num + 1) / 2)
2009 if ((uint)num2 < (uint)
source.Length &&
source[num2] == 48)
2030 if ((uint)num2 >= (uint)
source.Length)
2043 bytesConsumed = num2;
2063 if ((uint)num2 >= (uint)
source.Length)
2069 else if (num3 == 43)
2072 if ((uint)num2 >= (uint)
source.Length)
2086 if ((uint)num2 >= (uint)
source.Length)
2103 if ((uint)num4 <= 214748364u)
2105 num4 = num4 * 10 + num3 - 48;
2106 if ((uint)num4 <= 2147483647
L + (
long)((-1 * num + 1) / 2))
2120 if ((uint)num2 < (uint)
source.Length &&
source[num2] == 48)
2141 if ((uint)num2 >= (uint)
source.Length)
2154 bytesConsumed = num2;
2174 if ((uint)num2 >= (uint)
source.Length)
2180 else if (num3 == 43)
2183 if ((uint)num2 >= (uint)
source.Length)
2197 if ((uint)num2 >= (uint)
source.Length)
2214 if ((ulong)num4 <= 922337203685477580uL)
2216 num4 = num4 * 10 + num3 - 48;
2217 if ((ulong)num4 <= (ulong)(
long.MaxValue + (-1 * num + 1) / 2))
2231 if ((uint)num2 < (uint)
source.Length &&
source[num2] == 48)
2252 if ((uint)num2 >= (uint)
source.Length)
2265 bytesConsumed = num2;
2272 while (standardFormat != 0)
2274 switch (standardFormat | 0x20)
2286 standardFormat =
'\0';
2291 [CLSCompliant(
false)]
2294 while (standardFormat != 0)
2296 switch (standardFormat | 0x20)
2308 standardFormat =
'\0';
2313 [CLSCompliant(
false)]
2316 while (standardFormat != 0)
2318 switch (standardFormat | 0x20)
2330 standardFormat =
'\0';
2335 [CLSCompliant(
false)]
2338 while (standardFormat != 0)
2340 switch (standardFormat | 0x20)
2352 standardFormat =
'\0';
2376 if ((uint)num >= (uint)
source.Length)
2400 if ((uint)num < (uint)
source.Length)
2406 num3 = 10 * num3 + num2 - 48;
2407 if ((uint)num < (uint)
source.Length)
2413 num3 = num3 * 10 + num2 - 48;
2424 bytesConsumed = num;
2452 if ((uint)num >= (uint)
source.Length)
2476 if ((uint)num < (uint)
source.Length)
2482 num3 = 10 * num3 + num2 - 48;
2483 if ((uint)num < (uint)
source.Length)
2489 num3 = 10 * num3 + num2 - 48;
2490 if ((uint)num < (uint)
source.Length)
2496 num3 = 10 * num3 + num2 - 48;
2497 if ((uint)num < (uint)
source.Length)
2503 num3 = num3 * 10 + num2 - 48;
2518 bytesConsumed = num;
2519 value = (ushort)num3;
2546 if ((uint)num >= (uint)
source.Length)
2570 if ((uint)num < (uint)
source.Length)
2576 num3 = 10 * num3 + num2 - 48;
2577 if ((uint)num < (uint)
source.Length)
2583 num3 = 10 * num3 + num2 - 48;
2584 if ((uint)num < (uint)
source.Length)
2590 num3 = 10 * num3 + num2 - 48;
2591 if ((uint)num < (uint)
source.Length)
2597 num3 = 10 * num3 + num2 - 48;
2598 if ((uint)num < (uint)
source.Length)
2604 num3 = 10 * num3 + num2 - 48;
2605 if ((uint)num < (uint)
source.Length)
2611 num3 = 10 * num3 + num2 - 48;
2612 if ((uint)num < (uint)
source.Length)
2618 num3 = 10 * num3 + num2 - 48;
2619 if ((uint)num < (uint)
source.Length)
2625 num3 = 10 * num3 + num2 - 48;
2626 if ((uint)num < (uint)
source.Length)
2632 if ((uint)num3 <= 429496729u && (num3 != 429496729 || num2 <= 53))
2634 num3 = num3 * 10 + num2 - 48;
2661 bytesConsumed = num;
2674 nuint num = (uint)(
source[0] - 48);
2681 for (; (uint)i < (uint)
source.Length; i++)
2683 nuint num3 = (uint)(
source[i] - 48);
2688 num2 = num2 * 10 + num3;
2693 while ((uint)i < (uint)
source.Length)
2695 nuint num4 = (uint)(
source[i] - 48);
2701 if (num2 < 1844674407370955161
L)
2703 num2 = num2 * 10 + num4;
2706 if (num2 == 1844674407370955161
L && (uint)num4 <= 5)
2708 num2 = 18446744073709551610uL + (ulong)num4;
2738 if ((uint)num >= (uint)
source.Length)
2752 if ((uint)num >= (uint)
source.Length)
2769 num3 = num3 * 10 + num2 - 48;
2783 if ((uint)num < (uint)
source.Length &&
source[num] == 48)
2800 if ((uint)num >= (uint)
source.Length)
2813 bytesConsumed = num;
2834 if ((uint)num >= (uint)
source.Length)
2848 if ((uint)num >= (uint)
source.Length)
2865 num3 = num3 * 10 + num2 - 48;
2879 if ((uint)num < (uint)
source.Length &&
source[num] == 48)
2896 if ((uint)num >= (uint)
source.Length)
2909 bytesConsumed = num;
2910 value = (ushort)num3;
2930 if ((uint)num >= (uint)
source.Length)
2944 if ((uint)num >= (uint)
source.Length)
2961 if ((uint)num3 <= 429496729u && (num3 != 429496729 || num2 <= 53))
2963 num3 = num3 * 10 + num2 - 48;
2975 if ((uint)num < (uint)
source.Length &&
source[num] == 48)
2990 if ((uint)num >= (uint)
source.Length)
3003 bytesConsumed = num;
3026 if ((uint)num >= (uint)
source.Length)
3040 if ((uint)num >= (uint)
source.Length)
3057 if ((ulong)num3 <= 1844674407370955161uL && (num3 != 1844674407370955161
L || num2 <= 53))
3059 num3 = num3 * 10 + num2 - 48;
3071 if ((uint)num < (uint)
source.Length &&
source[num] == 48)
3086 if ((uint)num >= (uint)
source.Length)
3099 bytesConsumed = num;
3100 value = (ulong)num3;
3120 byte b = charToHexLookup[
index];
3121 if (b ==
byte.MaxValue)
3130 for (
int i = 1; i <
source.Length; i++)
3133 b = charToHexLookup[
index];
3134 if (b ==
byte.MaxValue)
3140 num = (num << 4) + b;
3145 for (
int j = 1; j < 2; j++)
3148 b = charToHexLookup[
index];
3149 if (b ==
byte.MaxValue)
3155 num = (num << 4) + b;
3157 for (
int k = 2; k <
source.Length; k++)
3160 b = charToHexLookup[
index];
3161 if (b ==
byte.MaxValue)
3173 num = (num << 4) + b;
3176 bytesConsumed =
source.Length;
3191 byte b = charToHexLookup[
index];
3192 if (b ==
byte.MaxValue)
3201 for (
int i = 1; i <
source.Length; i++)
3204 b = charToHexLookup[
index];
3205 if (b ==
byte.MaxValue)
3208 value = (ushort)num;
3211 num = (num << 4) + b;
3216 for (
int j = 1; j < 4; j++)
3219 b = charToHexLookup[
index];
3220 if (b ==
byte.MaxValue)
3223 value = (ushort)num;
3226 num = (num << 4) + b;
3228 for (
int k = 4; k <
source.Length; k++)
3231 b = charToHexLookup[
index];
3232 if (b ==
byte.MaxValue)
3235 value = (ushort)num;
3244 num = (num << 4) + b;
3247 bytesConsumed =
source.Length;
3248 value = (ushort)num;
3262 byte b = charToHexLookup[
index];
3263 if (b ==
byte.MaxValue)
3272 for (
int i = 1; i <
source.Length; i++)
3275 b = charToHexLookup[
index];
3276 if (b ==
byte.MaxValue)
3282 num = (num << 4) + b;
3287 for (
int j = 1; j < 8; j++)
3290 b = charToHexLookup[
index];
3291 if (b ==
byte.MaxValue)
3297 num = (num << 4) + b;
3299 for (
int k = 8; k <
source.Length; k++)
3302 b = charToHexLookup[
index];
3303 if (b ==
byte.MaxValue)
3309 if (num > 268435455)
3315 num = (num << 4) + b;
3318 bytesConsumed =
source.Length;
3333 byte b = charToHexLookup[
index];
3334 if (b ==
byte.MaxValue)
3343 for (
int i = 1; i <
source.Length; i++)
3346 b = charToHexLookup[
index];
3347 if (b ==
byte.MaxValue)
3353 num = (num << 4) + b;
3358 for (
int j = 1; j < 16; j++)
3361 b = charToHexLookup[
index];
3362 if (b ==
byte.MaxValue)
3368 num = (num << 4) + b;
3370 for (
int k = 16; k <
source.Length; k++)
3373 b = charToHexLookup[
index];
3374 if (b ==
byte.MaxValue)
3380 if (num > 1152921504606846975
L)
3386 num = (num << 4) + b;
3389 bytesConsumed =
source.Length;
3396 textUsedExponentNotation =
false;
3412 number.IsNegative =
true;
3423 if ((
byte)(b - 48) > 9)
3430 value = uint.MaxValue;
3431 for (i += 10; i !=
source.Length; i++)
3434 int num2 = (byte)(b - 48);
3441 i += bytesConsumed2;
3445 if (number.Scale <
int.MinValue +
value)
3447 number.Scale =
int.MinValue;
3451 number.Scale -= (int)
value;
3454 else if (number.Scale > 2147483647
L - (
long)
value)
3456 number.Scale =
int.MaxValue;
3460 number.Scale += (int)
value;
3463 number.DigitsCount = num;
3469 int num5 = digits.Length - 1;
3470 for (; i !=
source.Length; i++)
3485 while (i !=
source.Length)
3488 int num8 = (byte)(b - 48);
3500 number.HasNonZeroTail = num7 != 0;
3501 int num9 = i - num3;
3502 int num10 = i - num6;
3503 int num11 =
Math.
Min(num10, num5);
3504 source.Slice(num6, num11).CopyTo(digits);
3506 number.Scale = num10;
3510 number.DigitsCount = num;
3519 while (i !=
source.Length)
3522 int num14 = (byte)(b - 48);
3534 number.HasNonZeroTail = num7 != 0;
3539 for (; j < i &&
source[j] == 48; j++)
3544 int num15 =
Math.
Min(i - j, num5 - num);
3549 if (num9 == 0 && num12 == 0)
3555 number.DigitsCount = num;
3560 if (num9 == 0 && num12 == 0)
3565 if ((b & -33) != 69)
3568 number.DigitsCount = num;
3572 textUsedExponentNotation =
true;
3608 for (; i !=
source.Length; i++)
3611 if (b != 32 && b != 9)
3622 bool isNegative =
false;
3640 i += bytesConsumed2;
3653 i += bytesConsumed2;
3666 i += bytesConsumed2;
3679 i += bytesConsumed2;
3692 i += bytesConsumed2;
3717 bool isNegative = timeSpanSplitter.
IsNegative;
3757 switch (standardFormat)
3776 if (num ==
source.Length)
3782 uint num2 = (uint)(
source[num] - 48);
3792 while (num !=
source.Length)
3794 num2 = (uint)(
source[num] - 48);
3807 num3 = 10 * num3 + num2;
3833 bytesConsumed = num;
3837 private static bool TryCreateTimeSpan(
bool isNegative, uint days, uint hours, uint minutes, uint seconds, uint fraction, out
TimeSpan timeSpan)
3839 if (hours > 23 || minutes > 59 || seconds > 59)
3844 long num = ((long)days * 3600
L * 24 + (
long)hours * 3600
L + (long)minutes * 60
L + seconds) * 1000;
3849 if (num < -922337203685477
L)
3854 long num2 = num * 10000;
3855 if (num2 <
long.MinValue + fraction)
3860 ticks = num2 - fraction;
3864 if (num > 922337203685477
L)
3869 long num3 = num * 10000;
3870 if (num3 >
long.MaxValue - (
long)fraction)
3875 ticks = num3 + fraction;
3889 bool isNegative = timeSpanSplitter.
IsNegative;
static int ReadInt32LittleEndian(ReadOnlySpan< byte > source)
static bool TryParseThrowFormatException(out int bytesConsumed)
static bool IsDigit(int i)
static bool TryParse(ReadOnlySpan< byte > source, out ulong value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseSByteN(ReadOnlySpan< byte > source, out sbyte value, out int bytesConsumed)
static unsafe bool TryParse(ReadOnlySpan< byte > source, out double value, out int bytesConsumed, char standardFormat='\0')
static bool TryCreateTimeSpan(bool isNegative, uint days, uint hours, uint minutes, uint seconds, uint fraction, out TimeSpan timeSpan)
static bool TryParseInt32D(ReadOnlySpan< byte > source, out int value, out int bytesConsumed)
static readonly int[] s_daysToMonth366
static unsafe bool TryParse(ReadOnlySpan< byte > source, out decimal value, out int bytesConsumed, char standardFormat='\0')
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')
static bool TryCreateDateTimeOffset(DateTime dateTime, bool offsetNegative, int offsetHours, int offsetMinutes, out DateTimeOffset value)
static bool TryParseUInt32N(ReadOnlySpan< byte > source, out uint value, out int bytesConsumed)
static bool TryParseDateTimeOffsetR(ReadOnlySpan< byte > source, uint caseFlipXorMask, out DateTimeOffset dateTimeOffset, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out uint value, out int bytesConsumed, char standardFormat='\0')
static bool TryParse(ReadOnlySpan< byte > source, out byte value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseInt64N(ReadOnlySpan< byte > source, out long value, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out int value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseByteX(ReadOnlySpan< byte > source, out byte value, out int bytesConsumed)
static bool TryParseDateTimeOffsetO(ReadOnlySpan< byte > source, out DateTimeOffset value, out int bytesConsumed, out DateTimeKind kind)
static bool TryParseInt16N(ReadOnlySpan< byte > source, out short value, out int bytesConsumed)
static bool TryParseNumber(ReadOnlySpan< byte > source, ref Number.NumberBuffer number, out int bytesConsumed, ParseNumberOptions options, out bool textUsedExponentNotation)
static bool TryParseInt32N(ReadOnlySpan< byte > source, out int value, out int bytesConsumed)
static bool TryParseUInt16D(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out DateTimeOffset value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseUInt16X(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParseTimeSpanC(ReadOnlySpan< byte > source, out TimeSpan value, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out sbyte value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseInt64D(ReadOnlySpan< byte > source, out long value, out int bytesConsumed)
static bool TryParseUInt64N(ReadOnlySpan< byte > source, out ulong value, out int bytesConsumed)
static readonly int[] s_daysToMonth365
static bool TryParse(ReadOnlySpan< byte > source, out long value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseSByteD(ReadOnlySpan< byte > source, out sbyte value, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed, char standardFormat='\0')
static bool TryParse(ReadOnlySpan< byte > source, out DateTime value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseInt16D(ReadOnlySpan< byte > source, out short value, out int bytesConsumed)
static bool TryParseTimeSpanFraction(ReadOnlySpan< byte > source, out uint value, out int bytesConsumed)
static bool TryCreateDateTimeOffsetInterpretingDataAsLocalTime(int year, int month, int day, int hour, int minute, int second, int fraction, out DateTimeOffset value)
static bool TryCreateDateTime(int year, int month, int day, int hour, int minute, int second, int fraction, DateTimeKind kind, out DateTime value)
static unsafe bool TryParse(ReadOnlySpan< byte > source, out float value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseDateTimeOffsetDefault(ReadOnlySpan< byte > source, out DateTimeOffset value, out int bytesConsumed)
static bool TryParseUInt32D(ReadOnlySpan< byte > source, out uint value, out int bytesConsumed)
static bool TryParseAsSpecialFloatingPoint< T >(ReadOnlySpan< byte > source, T positiveInfinity, T negativeInfinity, T nan, out T value, out int bytesConsumed)
static bool TryParseGuidN(ReadOnlySpan< byte > text, out Guid value, out int bytesConsumed)
static bool TryParseUInt16N(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParseByteN(ReadOnlySpan< byte > source, out byte value, out int bytesConsumed)
static bool TryParseTimeSpanBigG(ReadOnlySpan< byte > source, out TimeSpan value, out int bytesConsumed)
static bool TryParseByteD(ReadOnlySpan< byte > source, out byte value, out int bytesConsumed)
static bool TryParseUInt32X(ReadOnlySpan< byte > source, out uint value, out int bytesConsumed)
static bool TryParseNormalAsFloatingPoint(ReadOnlySpan< byte > source, ref Number.NumberBuffer number, out int bytesConsumed, char standardFormat)
static bool TryParseTimeSpanLittleG(ReadOnlySpan< byte > source, out TimeSpan value, out int bytesConsumed)
static bool TryParseUInt64D(ReadOnlySpan< byte > source, out ulong value, out int bytesConsumed)
static bool TryCreateDateTimeOffset(int year, int month, int day, int hour, int minute, int second, int fraction, bool offsetNegative, int offsetHours, int offsetMinutes, out DateTimeOffset value)
static bool TryParse(ReadOnlySpan< byte > source, out TimeSpan value, out int bytesConsumed, char standardFormat='\0')
static bool TryParseGuidCore(ReadOnlySpan< byte > source, out Guid value, out int bytesConsumed, int ends)
static bool TryParseUInt64X(ReadOnlySpan< byte > source, out ulong value, out int bytesConsumed)
static bool TryParseDateTimeG(ReadOnlySpan< byte > source, out DateTime value, out DateTimeOffset valueAsOffset, out int bytesConsumed)
static bool TryParse(ReadOnlySpan< byte > source, out short value, out int bytesConsumed, char standardFormat='\0')
static bool TryParse(ReadOnlySpan< byte > source, out Guid value, out int bytesConsumed, char standardFormat='\0')
static ReadOnlySpan< byte > CharToHexLookup
static byte Min(byte val1, byte val2)
static unsafe bool TryNumberToDecimal(ref NumberBuffer number, ref decimal value)
static double NumberToDouble(ref NumberBuffer number)
static float NumberToSingle(ref NumberBuffer number)
static void ThrowFormatException_BadFormatSpecifier()
bool TrySplitTimeSpan(ReadOnlySpan< byte > source, bool periodUsedToSeparateDay, out int bytesConsumed)
static ComponentParseResult ParseComponent(ReadOnlySpan< byte > source, bool neverParseAsFraction, ref int srcIndex, out uint value)
static int DaysInMonth(int year, int month)
static bool IsLeapYear(int year)
Span< T > Slice(int start)