I am trying to create a config file for my application using yaml-cpp, I am able to create map by
YAML::Emitter emitter;
emitter << YAML::BeginMap;
emitter << YAML::Key << "Autoplay" << YAML::Value << "false";
emitter << YAML::EndMap;
std::ofstream ofout(file);
ofout << emitter.c_str();
which outputs something like,
var1: value1
var2: value2
But how would I make the top object like,
Foo:
var1: value1
var2: value2
Bar:
var3: value3
var4: value4
and so on.. How do I get the Foo and the Bar like in the above code.