rapidyaml  0.12.0
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 635 of file format.hpp.

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

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