Given this simple YAML example:
{CR: {ab: 12}}
I want to retrieve CR
. Perhaps I don't know the correct word to identify the "root key", hence I didn't find anything useful.
I use QtYaml that is based upon libyaml, in Ubuntu 20.04.
QString yaml = "{CR: {ab: 12}}";
YAML::Node root = YAML::Load(yaml.toStdString().c_str());
QString key;
YAML::convert<QString>().decode(root, key);
qDebug() << key;
It returns an empty string.
What I have to do in order to have key = "CR"
?