Function set_ref_maybe_replacing_scalar

Synopsis

#include <src/c4/yml/tree.hpp>

void set_ref_maybe_replacing_scalar(csubstr ref, bool has_scalar) noexcept

Description

No description yet.

Source

Lines 321-327 in src/c4/yml/tree.hpp.

void set_ref_maybe_replacing_scalar(csubstr ref, bool has_scalar) noexcept
{
    csubstr trimmed = ref.begins_with('*') ? ref.sub(1) : ref;
    anchor = trimmed;
    if((!has_scalar) || !scalar.ends_with(trimmed))
        scalar = ref;
}





Add Discussion as Guest

Log in