mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Added sandbox to play with
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
add_executable(sandbox sandbox.cpp)
|
||||||
|
target_link_libraries(sandbox yaml-cpp)
|
||||||
|
18
util/sandbox.cpp
Normal file
18
util/sandbox.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include "yaml-cpp/yaml.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
YAML::Emitter out;
|
||||||
|
out << YAML::BeginSeq;
|
||||||
|
out << "foo";
|
||||||
|
out << YAML::Comment("Skills");
|
||||||
|
out << YAML::BeginMap;
|
||||||
|
out << YAML::Key << "attack" << YAML::Value << 23;
|
||||||
|
out << YAML::Key << "intelligence" << YAML::Value << 56;
|
||||||
|
out << YAML::EndMap;
|
||||||
|
out << YAML::EndSeq;
|
||||||
|
|
||||||
|
std::cout << out.c_str() << "\n";
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user