rapidyaml  0.7.0
parse and emit YAML, and do it fast
uncatsep: deserialize the separated arguments from a string

Functions

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

Detailed Description

Function Documentation

◆ uncatsep()

template<class Sep , class Arg , class... Args>
size_t c4::uncatsep ( csubstr  buf,
Sep &  sep,
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(). 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 758 of file format.hpp.

759 {
760  size_t ret = from_chars_first(buf, &a), num = ret;
761  if(C4_UNLIKELY(ret == csubstr::npos))
762  return csubstr::npos;
763  buf = buf.len >= ret ? buf.sub(ret) : substr{};
764  ret = detail::uncatsep_more(buf, sep, more...);
765  if(C4_UNLIKELY(ret == csubstr::npos))
766  return csubstr::npos;
767  num += ret;
768  return num;
769 }
size_t from_chars_first(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy
Definition: format.hpp:476
@ npos
a null string position
Definition: common.hpp:266

References c4::from_chars_first(), and c4::yml::npos.

Referenced by sample::sample_formatting().