Is there a C++ library for emitting YAML? Wikipedia mentions a c++ wrapper for libyaml, but the link is broken. The official YAML site only offers yaml-cpp, which was also suggested in this SO question, but cpp-yaml is only a parser, not an emitter. Am I out of luck?
Edit: I'm looking for an object oriented interface, hence the C++ requirement. I know I could use libyaml's C interface in C++ code, but that's less than ideal.
A YAML::Emitter object acts as a state machine, and we use manipulators to move it between states. Here's a simple sequence: YAML::Emitter out; out << YAML::BeginSeq; out << "eggs"; out << "bread"; out << "milk"; out << YAML::EndSeq; produces.
YAML (Yet Another Markup Language) is a format for serializing data in a text file. It is similar to other textual data formats such as JSON and XML. YAML is widely used for storing configuration data for software applications, build systems, and deployment platforms.
YAML is a data serialization language that is often used for writing configuration files. Depending on whom you ask, YAML stands for yet another markup language or YAML ain't markup language (a recursive acronym), which emphasizes that YAML is for data, not documents.
YAML files store information, so they do not include actions and decisions. Unlike XML or JSON, YAML presents data in a way that makes it easy for a human to read. The simple syntax does not impact the language's capabilities. Any data or structure added to an XML or JSON file can also be stored in YAML.
Per your suggestion, yaml-cpp now has an emitter.
How about libyaml ?
LibYAML is a YAML 1.1 parser and emitter written in C.
And, more directly, emitter.c
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With