Closed Irallia closed 2 years ago
last-resort-writing (when no records are provided), happens in the destructor. Can you check whether the following works:
#include <bio/var_io/writer.hpp>
int main()
{
{
bio::var_io::header hdr{};
hdr.column_labels = {"CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER", "INFO", "FORMAT", "TEST"};
std::ostringstream stream{};
bio::var_io::writer writer{stream, bio::vcf{}};
writer.set_header(hdr);
}
std::cout << stream.str();
}
?
That works.
That works.
That's good to hear. That means it also works when exiting the program. In general, you cannot assum that the data appears immediately in the buffer of the string-stream, as the format may do additional buffering, too.
I will definitely need to improve the documentation on this 😇
You are of course always invited to do PRs with improvements or suggestions!
For the following snippet I would expect a VCF output with an empty body, but the output is empty.
but
prints