Namespace yml
Description
No description yet.
Preprocess_json
Convert JSON that may be not YAML to valid YAML.
{"a":"b"} ---> {"a": "b"}
- See
- https://stackoverflow.com/questions/42124227/why-does-the-yaml-spec-mandate-a-space-after-the-colon
- Note
- this is recursive - conversion happens on every tree node
- Parameters
json
- A relaxed mapbuf
- output bufferout
- output container
preprocess_json overload | Write into a given output buffer |
Preprocess_rxmap
Convert flow-type relaxed maps (with implicit bools) into strict YAML flow map.
{a, b, c, d: [e, f], g: {a, b}}
# is converted into this:
{a: 1, b: 1, c: 1, d: [e, f], g: {a, b}}
- Note
- this is NOT recursive - conversion happens only in the top-level map
- Parameters
rxmap
- A relaxed mapbuf
- output bufferout
- output container
preprocess_rxmap overload | Write into a given output buffer |
Other Types
report_error_impl | ||
error_impl | ||
allocate_impl | ||
free_impl | ||
Anonymous_0 | ||
LineCol | holds a position into a source buffer | |
Location | a source file position | |
using pfn_error = void(*)(const char *msg, size_t msg_len, Location location, void *user_data) | the type of the function used to report errors. This function must interrupt execution, either by raising an exception or calling std::abort(). | |
error overload | trigger an error: call the current error callback. | |
using pfn_allocate = void *(*)(size_t len, void *hint, void *user_data) | the type of the function used to allocate memory | |
using pfn_free = void(*)(void *mem, size_t size, void *user_data) | the type of the function used to free memory | |
Callbacks | a c-style callbacks class | |
get_callbacks | get the global callbacks | |
set_callbacks | set the global callbacks | |
reset_callbacks | set the global callbacks to their defaults | |
MemoryResource | ||
set_memory_resource | set the global memory resource | |
get_memory_resource | get the global memory resource | |
MemoryResourceCallbacks | a memory resource adapter to the c-style allocator | |
Allocator | an allocator is a lightweight non-owning handle to a memory resource | |
template <class OStream> | ||
using EmitterFile = Emitter< WriterFile > | ||
using EmitterBuf = Emitter< WriterBuf > | ||
EmitType_e | ||
as_json | mark a tree or node to be emitted as json | |
Emitter | ||
emit overload | emit YAML to the given file | |
emit overload | emit YAML to the given buffer | |
emit_json overload | emit JSON to the given file | |
emit_json overload | emit JSON to the given buffer | |
operator<< overload | emit YAML to an STL-like ostream | |
operator<< overload | emit YAML to an STL-like ostream This is an overloaded member function, provided for convenience | |
operator<< overload | emit json to the stream | |
emitrs overload | emit+resize: YAML to the given std::string/std::vector-like container, resizing it as needed to fit the emitted YAML. | |
emitrs_json overload | emit+resize: JSON to the given std::string/std::vector-like container, resizing it as needed to fit the emitted JSON. | |
Key | ||
Key< fmt::const_base64_wrapper > | ||
Key< fmt::base64_wrapper > | ||
key overload | ||
write overload | std::map requires child nodes in the data tree hierarchy (a MAP node in ryml parlance) | |
write overload | vector is a sequence-like type, and it requires child nodes in the data tree hierarchy (a SEQ node in ryml parlance) | |
read overload | ||
NodeRef | a reference to a node in an existing yaml tree, offering a more convenient API than the index-based API used in the tree. | |
from_next_line | look for the next newline chars, and jump to the right of those | |
Parser | ||
parse overload | parse in-situ a modifiable YAML source buffer. | |
parse overload | parse in-situ a modifiable YAML source buffer, providing a filename for error messages. | |
parse overload | parse a read-only YAML source buffer, copying it first to the tree's source arena. | |
parse overload | parse a read-only YAML source buffer, copying it first to the tree's source arena, providing a filename for error messages. | |
parse overload | reusing the YAML tree, parse in-situ a modifiable YAML source buffer | |
parse overload | reusing the YAML tree, parse in-situ a modifiable YAML source buffer, providing a filename for error messages. | |
parse overload | reusing the YAML tree, parse a read-only YAML source buffer, copying it first to the tree's source arena. | |
parse overload | reusing the YAML tree, parse a read-only YAML source buffer, copying it first to the tree's source arena, providing a filename for error messages. | |
C4_SUPPRESS_WARNING_GCC_WITH_PUSH | ||
using tag_bits = uint16_t | the integral type necessary to cover all the bits marking node types | |
typedef uint64_t type_bits | the integral type necessary to cover all the bits marking node types | |
to_chars_float | ||
from_chars_float | ||
YamlTag_e | a bit mask for marking tags for types | |
to_tag | ||
from_tag | ||
normalize_tag | ||
NodeType_e | a bit mask for marking node types | |
NodeType | wraps a NodeType_e element with some syntactic sugar and predicates | |
NodeScalar | a node scalar is a csubstr, which may be tagged and anchored. | |
C4_MUST_BE_TRIVIAL_COPY overload | ||
NodeInit | convenience class to initialize nodes | |
NodeData | contains the data for each YAML node. | |
Tree | Mentioned in
| |
RepC | Repeat-Character: a character to be written a number of times. | |
indent_to | ||
WriterFile | A writer that outputs to a file | |
WriterOStream | A writer that outputs to an STL-like ostream. | |
WriterBuf | a writer to a substr |
Source
Line 11 in src/c4/yml/common.cpp.