rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
Emit from ConstNodeRef

Functions

void c4::yml::emit_yaml (ConstNodeRef const &r, EmitOptions const &opts, FILE *f=nullptr)
 (1) emit YAML to the given file.
void c4::yml::emit_yaml (ConstNodeRef const &r, FILE *f=nullptr)
 (2) like (1), but use default emit options
void c4::yml::emit_json (ConstNodeRef const &r, EmitOptions const &opts, FILE *f=nullptr)
 (1) emit JSON to the given file.
void c4::yml::emit_json (ConstNodeRef const &r, FILE *f=nullptr)
 (2) like (1), but use default emit options

Detailed Description

Function Documentation

◆ emit_yaml() [1/2]

void c4::yml::emit_yaml ( ConstNodeRef const & r,
EmitOptions const & opts,
FILE * f = nullptr )

(1) emit YAML to the given file.

A null file defaults to stdout. Return the number of bytes written.

Definition at line 82 of file emit_file.cpp.

83{
84 EmitterFile em(opts, f);
85 em.emit_as(EMIT_YAML, r.tree(), r.id());
86}
Emitter< WriterFile > EmitterFile
Definition emit_file.hpp:25

◆ emit_yaml() [2/2]

void c4::yml::emit_yaml ( ConstNodeRef const & r,
FILE * f )

(2) like (1), but use default emit options

Definition at line 88 of file emit_file.cpp.

89{
90 EmitterFile em(EmitOptions{}, f);
91 em.emit_as(EMIT_YAML, r.tree(), r.id());
92}
A lightweight object containing options to be used when emitting.

◆ emit_json() [1/2]

void c4::yml::emit_json ( ConstNodeRef const & r,
EmitOptions const & opts,
FILE * f = nullptr )

(1) emit JSON to the given file.

A null file defaults to stdout. Return the number of bytes written.

Definition at line 94 of file emit_file.cpp.

95{
96 EmitterFile em(opts, f);
97 em.emit_as(EMIT_JSON, r.tree(), r.id());
98}

◆ emit_json() [2/2]

void c4::yml::emit_json ( ConstNodeRef const & r,
FILE * f )

(2) like (1), but use default emit options

Definition at line 100 of file emit_file.cpp.

101{
102 EmitterFile em(EmitOptions{}, f);
103 em.emit_as(EMIT_JSON, r.tree(), r.id());
104}