rapidyaml  0.7.2
parse and emit YAML, and do it fast
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. More...
 

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 634 of file format.hpp.

635 {
636  size_t out = from_chars_first(buf, &a);
637  if(C4_UNLIKELY(out == csubstr::npos))
638  return csubstr::npos;
639  buf = buf.len >= out ? buf.sub(out) : substr{};
640  size_t num = uncat(buf, more...);
641  if(C4_UNLIKELY(num == csubstr::npos))
642  return csubstr::npos;
643  return out + num;
644 }
size_t from_chars_first(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy
Definition: format.hpp:485
size_t uncat(csubstr buf, Arg &a, Args &...more)
deserialize the arguments from the given buffer.
Definition: format.hpp:634
@ npos
a null string position
Definition: common.hpp:266

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

Referenced by sample::sample_formatting().