Read the first valid sequence of characters from the string, skipping leading whitespace, and convert it using from_chars: generalized chars to value .
More...
|
| size_t | c4::from_chars_first (csubstr buf, uint8_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, uint16_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, uint32_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, uint64_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, int8_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, int16_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, int32_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, int64_t *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, float *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, double *v) noexcept |
| |
| template<class T > |
| auto | c4::from_chars_first (csubstr buf, T *v) noexcept-> size_t::type |
| |
| template<class T > |
| size_t | c4::from_chars_first (csubstr buf, T **v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, bool *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, char *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, csubstr *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, substr *v) noexcept |
| |
| size_t | c4::from_chars_first (csubstr buf, fmt::raw_wrapper *r) |
| | read a variable in raw binary format, using memcpy More...
|
| |
| size_t | c4::from_chars_first (csubstr buf, fmt::raw_wrapper r) |
| | read a variable in raw binary format, using memcpy More...
|
| |
Read the first valid sequence of characters from the string, skipping leading whitespace, and convert it using from_chars: generalized chars to value .
Return the number of characters read for converting.
Dispatches to the most appropriate and efficient conversion function.
- See also
- atou_first, atoi_first, atof_first, atod_first
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
uint8_t * |
v |
|
) |
| |
|
inlinenoexcept |
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
uint16_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2412 of file charconv.hpp.
size_t atou_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as an unsigned integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
uint32_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2413 of file charconv.hpp.
size_t atou_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as an unsigned integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
uint64_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2414 of file charconv.hpp.
size_t atou_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as an unsigned integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
int8_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2415 of file charconv.hpp.
size_t atoi_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as a signed integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
int16_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2416 of file charconv.hpp.
size_t atoi_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as a signed integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
int32_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2417 of file charconv.hpp.
size_t atoi_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as a signed integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
int64_t * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2418 of file charconv.hpp.
size_t atoi_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as a signed integral value...
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
float * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2419 of file charconv.hpp.
size_t atof_first(csubstr str, float *v) noexcept
Convert a string to a single precision real number.
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
double * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2420 of file charconv.hpp.
size_t atod_first(csubstr str, double *v) noexcept
Convert a string to a double precision real number.
template<class T >
| auto c4::from_chars_first |
( |
csubstr |
buf, |
|
|
T * |
v |
|
) |
| -> size_t ::type |
|
inlinenoexcept |
Definition at line 2422 of file charconv.hpp.
size_t atoi_first(csubstr str, T *v)
Select the next range of characters in the string that can be parsed as a signed integral value...
template<class T >
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
T ** |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2425 of file charconv.hpp.
2425 { intptr_t tmp;
bool ret =
from_chars_first(buf, &tmp);
if(ret) { *v = (T*)tmp; }
return ret; }
size_t from_chars_first(csubstr buf, substr *v) noexcept
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
bool * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2510 of file charconv.hpp.
bool from_chars(csubstr buf, substr *v) noexcept
basic_substring first_non_empty_span() const
get the first span consisting exclusively of non-empty characters
basic_substring< const char > csubstr
an immutable string view
| size_t c4::from_chars_first |
( |
csubstr |
buf, |
|
|
char * |
v |
|
) |
| |
|
inlinenoexcept |
Definition at line 2584 of file charconv.hpp.
2587 if(trimmed.len == 0)
2590 return static_cast<size_t>(trimmed.end() - buf.begin());
basic_substring first_non_empty_span() const
get the first span consisting exclusively of non-empty characters
basic_substring< const char > csubstr
an immutable string view
Definition at line 2637 of file charconv.hpp.
2640 C4_ASSERT(!trimmed.overlaps(*v));
2641 if C4_UNLIKELY(trimmed.len == 0)
2643 size_t len = trimmed.len > v->len ? v->len : trimmed.len;
2649 C4_ASSERT(buf.str !=
nullptr);
2650 C4_ASSERT(v->str !=
nullptr);
2651 memcpy(v->str, trimmed.str, len);
2653 if C4_UNLIKELY(trimmed.len > v->len)
2655 return static_cast<
size_t>(trimmed.end() - buf.begin());
basic_substring first_non_empty_span() const
get the first span consisting exclusively of non-empty characters
basic_substring< const char > csubstr
an immutable string view
read a variable in raw binary format, using memcpy
Definition at line 472 of file format.hpp.
bool from_chars(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy
read a variable in raw binary format, using memcpy
Definition at line 478 of file format.hpp.
bool from_chars(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy