rapidyaml  0.16.0
parseandemitYAML,anddoitfast
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

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

Referenced by sample_formatting().

691 {
692  size_t out = from_chars_first(buf, &a);
693  if C4_UNLIKELY(out == csubstr::npos)
694  return csubstr::npos;
695  buf = buf.len >= out ? buf.sub(out) : substr{};
696  size_t num = uncat(buf, more...);
697  if C4_UNLIKELY(num == csubstr::npos)
698  return csubstr::npos;
699  return out + num;
700 }
size_t from_chars_first(csubstr buf, fmt::raw_wrapper r)
read a variable in raw binary format, using memcpy
Definition: format.hpp:478
basic_substring< char > substr
a mutable string view
Definition: substr.hpp:2355
a null string position
Definition: common.hpp:138
basic_substring< const char > csubstr
an immutable string view
Definition: substr.hpp:2356
size_t uncat(csubstr buf, Arg &a, Args &...more)
deserialize the arguments from the given buffer.
Definition: format.hpp:690