rivet is hosted by Hepforge, IPPP Durham
test.cc File Reference
#include <fstream>
#include <string>
#include <iostream>
#include "yaml.h"
Include dependency graph for test.cc:

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main ( )

Definition at line 8 of file test.cc.

References Rivet::s.

{
  ifstream io("test.yaml");
  YAML::Parser parser(io);

  YAML::Node doc;
  parser.GetNextDocument(doc);
  
  const YAML::Node& things = doc["things"];
  string s;
  for (YAML::Iterator it = things.begin(); it != things.end(); ++it) {
    *it >> s;
    cout << "&&& " << s << " &&&" << endl;
  }

  const YAML::Node& stuff = doc["stuff"];
  int a;
  for (YAML::Iterator it = stuff.begin(); it != stuff.end(); ++it) {
    *it >> a;
    cout << "%%% " << a << " %%%" << endl;
  }

  const YAML::Node& desc = doc["desc"];
  string d;
  desc >> d;
  cout << "*** " << d << " ***" << endl;

  parser.GetNextDocument(doc);

  return 0;
}