yaml-cpp/util/sandbox.cpp

21 lines
554 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 08:47:57 +04:00
out << "pencils" << "b";
2012-05-22 08:29:59 +04:00
out << YAML::EndMap;
2012-05-22 08:47:57 +04:00
out << "item 2";
2012-05-22 06:04:10 +04:00
out << YAML::EndSeq;
2012-05-20 10:46:08 +04:00
std::cout << out.c_str() << "\n";
return 0;
}