Namespace sample
Description
tbese are only needed for the examples below
<ryml_std.hpp> is only needed if interop with std types is desired. ryml itself does not use any STL container. CONTENTS:
(Each function addresses a topic and is fully self-contained. Jump to the function to find out about its topic.)
Summary
sample_quick_overview | briefly skim over most of the features | |
sample_substr | about ryml's string views (from c4core) | |
sample_parse_file | ready-to-go example of parsing a file from disk | |
sample_parse_read_only | parse a read-only YAML source buffer | |
sample_parse_in_situ | parse an immutable YAML source buffer | |
sample_parse_reuse_tree | parse into an existing tree, maybe into a node | |
sample_parse_reuse_parser | reuse an existing parser | |
sample_parse_reuse_tree_and_parser | how to reuse existing trees and parsers | |
sample_iterate_trees | visit individual nodes and iterate through trees | |
sample_create_trees | programatically create trees | |
sample_tree_arena | interact with the tree's serialization arena | |
sample_fundamental_types | serialize/deserialize fundamental types | |
sample_formatting | control formatting when serializing/deserializing | |
sample_base64 | encode/decode base64 | |
sample_user_scalar_types | serialize/deserialize scalar (leaf/string) types | |
sample_user_container_types | serialize/deserialize container (map or seq) types | |
sample_std_types | serialize/deserialize STL containers | |
sample_emit_to_container | emit to memory, eg a string or vector-like container | |
sample_emit_to_stream | emit to a stream, eg std::ostream | |
sample_emit_to_file | emit to a FILE* | |
sample_emit_nested_node | pick a nested node as the root when emitting | |
sample_json | JSON parsing and emitting. | |
sample_anchors_and_aliases | deal with YAML anchors and aliases | |
sample_tags | deal with YAML type tags | |
sample_docs | deal with YAML docs | |
sample_error_handler | set a custom error handler | |
sample_global_allocator | set a global allocator for ryml | |
sample_per_tree_allocator | set per-tree allocators | |
report_checks | ||
report_check | ||
file_get_contents overload | helper functions for sample_parse_file() | |
file_put_contents overload | save a buffer into a file | |
vec2 | user scalar types: implemented in ryml through to_chars() + from_chars() | |
vec3 | ||
vec4 | ||
parse_only_vec2 | ||
parse_only_vec3 | ||
parse_only_vec4 | ||
emit_only_vec2 | ||
emit_only_vec3 | ||
emit_only_vec4 | ||
to_chars overload | to_chars(): only needed for emitting | |
from_chars overload | from_chars(): only needed for parsing | |
my_seq_type | user container type: seq-like | |
write overload | ||
read overload | ||
my_map_type | user container type: map-like | |
my_type | user container type: notice all the members are complex types defined above | |
ErrorHandlerExample | ||
GlobalAllocatorExample | Please note the following about the use of custom allocators with ryml | |
PerTreeMemoryExample | ||
C4_SUPPRESS_WARNING_MSVC_WITH_PUSH | helper functions for sample_parse_file() | |
CharContainer * v { ::FILE *fp = ::fopen(filename, "rb") | ||
C4_CHECK_MSG | ||
long sz = ::ftell(fp) | ||
resize | ||
if | ||
size |
Source
Line 47 in samples/quickstart.cpp.