Added constructor to the Emitter with a stream, so you can write directly to a stream instead of our temp

This commit is contained in:
Jesse Beder
2012-05-25 18:22:33 -05:00
parent e6d4a915dc
commit 2ffdc5b4d1
5 changed files with 32 additions and 11 deletions

View File

@@ -3,12 +3,10 @@
int main()
{
YAML::Emitter out;
YAML::Emitter out(std::cout);
out << YAML::BeginSeq;
out << "item 1";
out << YAML::BeginSeq << "foo 1" << "bar 2" << YAML::EndSeq;
out << YAML::EndSeq;
std::cout << out.c_str() << "\n";
return 0;
}