rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
uncat: read concatenated arguments from string

Functions

template<class Arg, class... Args>
size_t c4::uncat (csubstr buf, Arg &a, Args &...more)
 deserialize the arguments from the given buffer.

Detailed Description

Function Documentation

◆ uncat()

template<class Arg, class... Args>
size_t c4::uncat ( csubstr buf,
Arg & a,
Args &... more )

deserialize the arguments from the given buffer.

Returns
the number of characters read from the buffer, or csubstr::npos if a conversion was not successful.
See also
c4::cat(). c4::uncat() is the inverse of c4::cat().

Definition at line 690 of file format.hpp.

691{
692 size_t out = from_chars_first(buf, &a);
693 if(C4_UNLIKELY(out == csubstr::npos))
694 return csubstr::npos;
695 buf = buf.len >= out ? buf.sub(out) : substr{};
696 size_t num = uncat(buf, more...);
697 if(C4_UNLIKELY(num == csubstr::npos))
698 return csubstr::npos;
699 return out + num;
700}
size_t from_chars_first(csubstr buf, uint8_t *v) noexcept
basic_substring< char > substr
a mutable string view
Definition substr.hpp:2356
size_t uncat(csubstr buf, Arg &a, Args &...more)
deserialize the arguments from the given buffer.
Definition format.hpp:690
size_t len
the length of the substring
Definition substr.hpp:218
basic_substring sub(size_t first) const noexcept
return [first,len[
Definition substr.hpp:503