Files
yaml-cpp/util/sandbox.cpp
T

21 lines
554 B
C++
Raw Normal View History

2012-05-20 01:46:08 -05:00
#include "yaml-cpp/yaml.h"
#include <iostream>
int main()
{
YAML::Emitter out;
2012-05-22 12:29:36 -05:00
out << YAML::Comment("Hello");
2012-05-21 21:04:10 -05:00
out << YAML::BeginSeq;
2012-05-22 12:54:54 -05:00
out << YAML::Comment("Hello");
out << YAML::Anchor("a") << YAML::Comment("anchor") << "item 1" << YAML::Comment("a");
out << YAML::BeginMap << YAML::Comment("b");
out << "pens" << YAML::Comment("foo") << "a" << YAML::Comment("bar");
2012-05-21 23:47:57 -05:00
out << "pencils" << "b";
2012-05-21 23:29:59 -05:00
out << YAML::EndMap;
2012-05-21 23:47:57 -05:00
out << "item 2";
2012-05-21 21:04:10 -05:00
out << YAML::EndSeq;
2012-05-20 01:46:08 -05:00
std::cout << out.c_str() << "\n";
return 0;
}