When trying something with yaml-cpp I was stuck at strings.. Especially since they seem to not round-trip well...
When I read a string from a file - and then later export that string there seems to be an artifact when exporting.. Ie the string:
%YAML 1.2
---
key1: "this is a string"
key2: this is another
...
When I simply read & write that some extra characters are added to the first "keyvalue":
::YAML::Node y(YAML::LoadFile("testyaml.txt"));
std::fstream out("testyaml2.yml", std::ios_base::out);
YAML::Emitter em(out);
em.SetIndent(2);
em.SetStringFormat(DoubleQuoted); //just to add quotes
em << y;
However now the file looks like:
"key1": !<!> "this is a string"
"key2": "this is another"
I can live with "losing" the header information - or the fact that quotes are added everywhere (well I simply told the parser to do that right?). However the !<!>
are not nice. Especially since this will keep going on each cycle (a second read/write cycle will add two times that artifact etc etc).
Is there an option to prevent those exclamation signs - why are they there?