How do i write multiline yaml file, that looks like this:

I am using c++ library yaml-cpp.
Here is a peek to my code:
YAML::Emitter out; out << YAML::BeginMap; out << YAML::Key << "name" << YAML::Value << "PKS2023/24" << YAML::Key << "pcap_name" << YAML::Value << "abcd.pcap"; out << YAML::Key << "packets" << YAML::Value;
I tried new mapping iside the hexa_frame value. But it started a new line and loosed the | pipe.
The value for
hexa_frameis just a long string with embedded newlines. You can convince yaml-cpp to generate it usingYAML::Literal: