I need to save text data to a YAML file exactly as it is, so that another program can subsequently read the file and transmit the data over the network without modification. At the same time, I need to maintain the YAML file's readability.
To preserve readability when saving the text data, I use the YAML::Literal manipulator.
The problem with this manipulator is that it strips all trailing newlines from the text, whereas I need to preserve them. Additionally, when reading the data back as a std::string, a newline character (\n) is appended to the end.
In other words, I need to save text data to YAML file exactly as is and be able to read it back exactly as is. Does yaml-cpp provide any mechanisms for this?
I need to save text data to a
YAMLfile exactly as it is, so that another program can subsequently read the file and transmit the data over the network without modification. At the same time, I need to maintain theYAMLfile's readability.To preserve readability when saving the text data, I use the
YAML::Literalmanipulator.The problem with this manipulator is that it strips all trailing newlines from the text, whereas I need to preserve them. Additionally, when reading the data back as a
std::string, a newline character (\n) is appended to the end.In other words, I need to save text data to
YAMLfile exactly as is and be able to read it back exactly as is. Doesyaml-cppprovide any mechanisms for this?