#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 cout << "---------------------" << doc << "---------------------" << endl; 00016 00017 const YAML::Node& things = doc["things"]; 00018 string s; 00019 for (YAML::Iterator it = things.begin(); it != things.end(); ++it) { 00020 *it >> s; 00021 cout << "&&& " << s << " &&&" << endl; 00022 } 00023 00024 const YAML::Node& stuff = doc["stuff"]; 00025 int a; 00026 for (YAML::Iterator it = stuff.begin(); it != stuff.end(); ++it) { 00027 *it >> a; 00028 cout << "%%% " << a << " %%%" << endl; 00029 } 00030 00031 const YAML::Node& desc = doc["desc"]; 00032 string d; 00033 desc >> d; 00034 cout << "*** " << d << " ***" << endl; 00035 00036 parser.GetNextDocument(doc); 00037 cout << "---------------------" << doc << "---------------------" << endl; 00038 00039 return 0; 00040 }