the content of the yaml file I hope is
AAA:
- BBB:
a: 1
b: 2
the code I write is like
FileStorage fw("./config.yaml", FileStorage::WRITE);
fw << "AAA" << "[" << "{";
fw << "BBB" << "{";
fw << "a" << 1;
fw << "b" << 2;
fw << "}" << "}" << "]";
while the output of config.yaml is like
AAA:
-
BBB:
a: 1
b: 2
the "-" and "BBB" are not in a line.
how can I solve this problem?
↧