rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
uncatsep: deserialize the separated arguments from a string

Functions

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

Detailed Description

Function Documentation

◆ uncatsep()

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

deserialize the arguments from the given buffer, using a separator.

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

Definition at line 819 of file format.hpp.

820{
821 if(C4_LIKELY(sep.len > 0))
822 {
823 size_t pos = buf.find(sep);
824 if(C4_LIKELY(pos != csubstr::npos))
825 {
826 if(C4_LIKELY(from_chars(buf.first(pos), &a)))
827 {
828 pos += sep.len;
829 size_t num = uncatsep(buf.sub(pos), sep, more...);
830 if(C4_LIKELY(num != csubstr::npos))
831 return pos + num;
832 }
833 }
834 }
835 return csubstr::npos;
836}
bool from_chars(csubstr buf, uint8_t *v) noexcept
size_t uncatsep(csubstr buf, csubstr sep, Arg &a, Args &...more)
deserialize the arguments from the given buffer, using a separator.
Definition format.hpp:819
size_t len
the length of the substring
Definition substr.hpp:218
size_t find(const C c, size_t start_pos=0) const
Definition substr.hpp:714
basic_substring first(size_t num) const noexcept
return the first num elements: [0,num[
Definition substr.hpp:530
basic_substring sub(size_t first) const noexcept
return [first,len[
Definition substr.hpp:503