Function read

Summary

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

(1) template <class T>
    bool read(NodeRef const &n, T *v)

#include <src/c4/yml/std/map.hpp>

(2) template <class K, class V, class Less, class Alloc>
    bool read(c4::yml::NodeRef const &n, std::map< K, V, Less, Alloc > *m)

#include <src/c4/yml/std/vector.hpp>

(3) template <class V, class Alloc>
    bool read(c4::yml::NodeRef const &n, std::vector< V, Alloc > *vec)

Function overload

Synopsis

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

template <class T>
bool read(NodeRef const &n, T *v)

Description

No description yet.

Mentioned in

Source

Lines 792-796 in src/c4/yml/node.hpp. Line 27 in src/c4/yml/node.hpp.

template<class T>
inline bool read(NodeRef const& n, T *v)
{
    return from_chars(n.val(), v);
}

Synopsis

#include <src/c4/yml/std/map.hpp>

template <class K, class V, class Less, class Alloc>
bool read(c4::yml::NodeRef const &n, std::map< K, V, Less, Alloc > *m)

Description

No description yet.

Mentioned in

Source

Lines 28-40 in src/c4/yml/std/map.hpp.

template<class K, class V, class Less, class Alloc>
bool read(c4::yml::NodeRef const& n, std::map<K, V, Less, Alloc> * m)
{
    K k{};
    V v;
    for(auto const ch : n)
    {
        ch >> c4::yml::key(k);
        ch >> v;
        m->emplace(std::make_pair(std::move(k), std::move(v)));
    }
    return true;
}

Synopsis

#include <src/c4/yml/std/vector.hpp>

template <class V, class Alloc>
bool read(c4::yml::NodeRef const &n, std::vector< V, Alloc > *vec)

Description

No description yet.

Mentioned in

Source

Lines 25-35 in src/c4/yml/std/vector.hpp.

template<class V, class Alloc>
bool read(c4::yml::NodeRef const& n, std::vector<V, Alloc> *vec)
{
    vec->resize(n.num_children());
    size_t pos = 0;
    for(auto const ch : n)
    {
        ch >> (*vec)[pos++];
    }
    return true;
}





Add Discussion as Guest

Log in