Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yaml Emitter in C++

Tags:

c++

yaml

yaml-cpp

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.

like image 784
Kyle Simek Avatar asked Apr 16 '09 04:04

Kyle Simek


People also ask

What is a YAML emitter?

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.

What is YAML parser?

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.

What is YAML configuration?

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.

How do YAML files work?

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.


2 Answers

Per your suggestion, yaml-cpp now has an emitter.

like image 173
Jesse Beder Avatar answered Sep 26 '22 00:09

Jesse Beder


How about libyaml ?

LibYAML is a YAML 1.1 parser and emitter written in C.

And, more directly, emitter.c ?

like image 21
gimel Avatar answered Sep 22 '22 00:09

gimel