846 {
847 const char* p = span.
data();
848 const char*
end = p + span.
size();
849
851
852 while (p <
end && (*p ==
' ' || *p ==
'\t' || *p ==
'\n' || *p ==
'\r')) p++;
854
855
856 const char* num_start = p;
857 bool is_float = false;
858
859 if (*p == '-') p++;
860 while (p < end && *p >= '0' && *p <= '9') p++;
861
862 if (p <
end && *p ==
'.') {
863 is_float = true;
864 p++;
865 while (p < end && *p >= '0' && *p <= '9') p++;
866 }
867
868 if (p <
end && (*p ==
'e' || *p ==
'E')) {
869 is_float = true;
870 p++;
871 if (p <
end && (*p ==
'+' || *p ==
'-')) p++;
872 while (p < end && *p >= '0' && *p <= '9') p++;
873 }
874
875 T val;
876 if (is_float) {
877#if FL_PLATFORM_HAS_LARGE_MEMORY
878
879
880
881
884#else
885
886
887
888 val = static_cast<T>(0);
889#endif
890 } else {
891 val =
static_cast<T
>(
fl::parseInt(num_start, p - num_start));
892 }
894
895
896 while (p <
end && (*p ==
' ' || *p ==
'\t' || *p ==
'\n' || *p ==
'\r')) p++;
897
898
899 if (p <
end && *p ==
',') p++;
900 }
901
902 return true;
903 }
const T * data() const FL_NO_EXCEPT
constexpr fl::size size() const FL_NO_EXCEPT
void push_back(const T &value) FL_NO_EXCEPT
u32 ieee754_parse_decimal(const char *s, fl::size len, fl::size *consumed) FL_NO_EXCEPT
Parse a decimal floating-point number into IEEE 754 single-precision bits.
int parseInt(const char *str, fl::size len)
Parse an integer from a character buffer.
To bit_cast(const From &from) FL_NO_EXCEPT