rapidyaml  0.13.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 694 of file format.hpp.

695 {
696  size_t out = from_chars_first(buf, &a);
697  if(C4_UNLIKELY(out == csubstr::npos))
698  return csubstr::npos;
699  buf = buf.len >= out ? buf.sub(out) : substr{};
700  size_t num = uncat(buf, more...);
701  if(C4_UNLIKELY(num == csubstr::npos))
702  return csubstr::npos;
703  return out + num;
704 }
size_t from_chars_first(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy
Definition: format.hpp:482
size_t uncat(csubstr buf, Arg &a, Args &...more)
deserialize the arguments from the given buffer.
Definition: format.hpp:694
@ npos
a null string position
Definition: common.hpp:258