yaml-cpp/util/sandbox.cpp

22 lines
613 B
C++
Raw Normal View History

2012-05-20 10:46:08 +04:00
#include "yaml-cpp/yaml.h"
#include <iostream>
int main()
{
YAML::Emitter out;
2012-05-22 21:29:36 +04:00
out << YAML::Comment("Hello");
2012-05-22 06:04:10 +04:00
out << YAML::BeginSeq;
2012-05-22 21:54:54 +04: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-22 22:57:44 +04:00
out << "pencils" << 15;
2012-05-22 21:59:58 +04:00
out << YAML::EndMap << YAML::Comment("monkey");
2012-05-22 08:47:57 +04:00
out << "item 2";
2012-05-22 06:04:10 +04:00
out << YAML::EndSeq;
2012-05-22 21:59:58 +04:00
out << YAML::Comment("end");
2012-05-20 10:46:08 +04:00
std::cout << out.c_str() << "\n";
return 0;
}