|
rapidyaml 0.16.0
parse and emit YAML, and do it fast
|
Functions | |
| void | sample_fundamental_types () |
| serialize/deserialize fundamental types | |
| void | sample_empty_null_values () |
| serialize/deserialize/query empty or null values | |
| void | sample_formatting () |
| control formatting when serializing/deserializing | |
| void | sample_base64 () |
| encode/decode base64 | |
| void | sample_serialize_basic () |
| serialize/deserialize fundamental types | |
| void | sample_user_scalar_types () |
| serialize/deserialize scalar (leaf/scalar) types | |
| void | sample_user_container_types_brief () |
| serialize/deserialize container (map or seq) types: brief version | |
| void | sample_user_container_types () |
| serialize/deserialize container (map or seq) types | |
| void | sample_std_types () |
| serialize/deserialize STL containers | |
| void | sample_deserialize_error () |
| shows error on deserializing nested nodes | |
| void | sample_float_precision () |
| control precision of serialized floats | |
| void sample_fundamental_types | ( | ) |
serialize/deserialize fundamental types
ryml provides facilities for serializing and deserializing the C++ fundamental types, including boolean and null values; this is provided by the several overloads in to_chars: generalized chars to value and from_chars: generalized chars to value.
To add serialization for user scalar types (ie, those types that should be serialized as strings in leaf nodes), you just need to define the appropriate overloads of to_chars and from_chars for those types; see sample_user_scalar_types for an example on how to achieve this, and see Serialization/deserialization for more information on serialization.
Definition at line 3017 of file quickstart.cpp.
Referenced by main().
| void sample_empty_null_values | ( | ) |
serialize/deserialize/query empty or null values
Shows how to deal with empty/null values.
See also c4::yml::Tree::val_is_null
Definition at line 3109 of file quickstart.cpp.
Referenced by main().
| void sample_formatting | ( | ) |
control formatting when serializing/deserializing
ryml provides facilities for formatting/deformatting (imported from c4core into the ryml namespace).
See Format utilities . These functions are very useful to serialize and deserialize scalar types; see Serialization/deserialization .
Definition at line 3280 of file quickstart.cpp.
Referenced by main().
| void sample_base64 | ( | ) |
encode/decode base64
demonstrates how to read and write base64-encoded blobs.
Definition at line 3706 of file quickstart.cpp.
Referenced by main().
| void sample_serialize_basic | ( | ) |
serialize/deserialize fundamental types
This sample shows the main user-facing calls triggering (de)serialization.
ryml provides built-ins for all fundamental types. For samples on how to implement other types such as STL containers or user types, see the samples below.
Read also the doxygen intro to using serialization
And likewise, you can use these from the tree as well: c4::yml::Tree::set_serialized() / c4::yml::Tree::set_key_serialized().
For deserialization, use from_chars().
Definition at line 3874 of file quickstart.cpp.
Referenced by main().
| void sample_user_scalar_types | ( | ) |
serialize/deserialize scalar (leaf/scalar) types
to add scalar types (ie leaf types converting to/from string), define the functions above for those types.
See Serialize/deserialize scalar types.
Definition at line 4018 of file quickstart.cpp.
Referenced by main().
| void sample_user_container_types_brief | ( | ) |
serialize/deserialize container (map or seq) types: brief version
shows a minimal example of user container types, defined in Serialize container types (brief)
Definition at line 4143 of file quickstart.cpp.
Referenced by main().
| void sample_user_container_types | ( | ) |
serialize/deserialize container (map or seq) types
shows how to serialize/deserialize container types (defined in Serialize container types).
Definition at line 4414 of file quickstart.cpp.
Referenced by main().
| void sample_std_types | ( | ) |
serialize/deserialize STL containers
demonstrates usage with the std implementations provided by ryml in the ryml_std.hpp header
Definition at line 4563 of file quickstart.cpp.
Referenced by main().
| void sample_deserialize_error | ( | ) |
shows error on deserializing nested nodes
shows what happens on deserialization errors
Definition at line 4513 of file quickstart.cpp.
Referenced by main().
| void sample_float_precision | ( | ) |
control precision of serialized floats
Definition at line 4629 of file quickstart.cpp.
Referenced by main().