#include <fstream>
#include <string>
#include <iostream>
#include "yaml.h"
Go to the source code of this file.
Functions | |
int | main () |
int main | ( | ) |
Definition at line 8 of file test.cc.
References Rivet::s.
00009 { 00010 ifstream io("test.yaml"); 00011 YAML::Parser parser(io); 00012 00013 YAML::Node doc; 00014 parser.GetNextDocument(doc); 00015 00016 const YAML::Node& things = doc["things"]; 00017 string s; 00018 for (YAML::Iterator it = things.begin(); it != things.end(); ++it) { 00019 *it >> s; 00020 cout << "&&& " << s << " &&&" << endl; 00021 } 00022 00023 const YAML::Node& stuff = doc["stuff"]; 00024 int a; 00025 for (YAML::Iterator it = stuff.begin(); it != stuff.end(); ++it) { 00026 *it >> a; 00027 cout << "%%% " << a << " %%%" << endl; 00028 } 00029 00030 const YAML::Node& desc = doc["desc"]; 00031 string d; 00032 desc >> d; 00033 cout << "*** " << d << " ***" << endl; 00034 00035 parser.GetNextDocument(doc); 00036 00037 return 0; 00038 }