Function parse

Summary

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

(1) Tree parse(csubstr filename, csubstr src)

(2) Tree parse(csubstr filename, substr src)

(3) void parse(csubstr filename, substr src, Tree *t)

(4) void parse(csubstr filename, csubstr src, Tree *t)

(5) void parse(csubstr filename, substr src, Tree *t, size_t node_id)

(6) void parse(csubstr filename, csubstr src, Tree *t, size_t node_id)

(7) void parse(csubstr filename, substr src, NodeRef node)

(8) void parse(csubstr filename, csubstr src, NodeRef node)

Function overload

Synopsis

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

Tree parse(csubstr filename, csubstr src)

Description

create a new YAML tree and parse into its root

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 41-41 in src/c4/yml/parse.hpp.

Tree parse(csubstr filename, csubstr src) { Tree t; t.reserve(_estimate_capacity(src)); parse(filename, t.copy_to_arena(src), &t, t.root_id()); return t; }

Synopsis

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

Tree parse(csubstr filename, substr src)

Description

create a new YAML tree and parse into its root

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 45-45 in src/c4/yml/parse.hpp.

Tree parse(csubstr filename,  substr src) { Tree t; t.reserve(_estimate_capacity(src)); parse(filename, src, &t, t.root_id()); return t; }

Synopsis

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

void parse(csubstr filename, substr src, Tree *t)

Description

parse with reuse of a YAML tree

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 51-51 in src/c4/yml/parse.hpp.

void parse(csubstr filename,  substr src, Tree *t) { parse(filename, src, t, t->root_id()); }

Synopsis

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

void parse(csubstr filename, csubstr src, Tree *t)

Description

parse with reuse of a YAML tree

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 55-55 in src/c4/yml/parse.hpp.

void parse(csubstr filename, csubstr src, Tree *t) { parse(filename, t->copy_to_arena(src), t, t->root_id()); }

Synopsis

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

void parse(csubstr filename, substr src, Tree *t, size_t node_id)

Description

parse directly into a node

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 160-181 in src/c4/yml/parse.cpp. Line 61 in src/c4/yml/parse.hpp.

void Parser::parse(csubstr file, substr buf, Tree *t, size_t node_id)
{
    m_file = file;
    m_buf = buf;
    m_root_id = node_id;
    m_tree = t;

    _reset();

    while( ! _finished_file())
    {
        _scan_line();
        while( ! _finished_line())
        {
            _handle_line();
        }
        if(_finished_file()) break; // it may have finished because of multiline blocks
        _line_ended();
    }

    _handle_finished_file();
}

Synopsis

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

void parse(csubstr filename, csubstr src, Tree *t, size_t node_id)

Description

parse directly into a node

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 65-65 in src/c4/yml/parse.hpp.

void parse(csubstr filename, csubstr src, Tree *t, size_t node_id) { parse(filename, t->copy_to_arena(src), t, node_id); }

Synopsis

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

void parse(csubstr filename, substr src, NodeRef node)

Description

parse directly into a node ref

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 71-71 in src/c4/yml/parse.hpp.

void parse(csubstr filename,  substr src, NodeRef node) { parse(filename, src, node.tree(), node.id()); }

Synopsis

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

void parse(csubstr filename, csubstr src, NodeRef node)

Description

parse directly into a node ref

Note
aliases and anchors are not resolved. You can resolve by calling Tree::resolve() after parsing.

Mentioned in

Source

Lines 75-75 in src/c4/yml/parse.hpp.

void parse(csubstr filename, csubstr src, NodeRef node) { parse(filename, node.tree()->copy_to_arena(src), node.tree(), node.id()); }





Add Discussion as Guest

Log in