Function uncatsep

Synopsis

#include <src/c4/format.hpp>

template <class Sep, class Arg, class... Args>
size_t uncatsep(csubstr buf, Sep &C4_RESTRICT sep, Arg &C4_RESTRICT a, Args &C4_RESTRICT ...more)

Description

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
c4::catsep(). c4::uncatsep() is the inverse of c4::catsep().

Mentioned in

Source

Lines 577-587 in src/c4/format.hpp.

template<class Sep, class Arg, class... Args>
size_t uncatsep(csubstr buf, Sep & C4_RESTRICT sep, Arg & C4_RESTRICT a, Args & C4_RESTRICT ...more)
{
    size_t ret = from_chars_first(buf, &a), num = ret;
    if(C4_UNLIKELY(ret == csubstr::npos)) return csubstr::npos;
    buf  = buf.len >= ret ? buf.sub(ret) : substr{};
    ret  = detail::uncatsep_more(buf, sep, more...);
    if(C4_UNLIKELY(ret == csubstr::npos)) return csubstr::npos;
    num += ret;
    return num;
}





Add Discussion as Guest

Log in