2009-07-10 07:10:03 +04:00
|
|
|
#include "yaml.h"
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2009-07-10 08:25:11 +04:00
|
|
|
std::ifstream fin;
|
|
|
|
if(argc > 1)
|
|
|
|
fin.open(argv[1]);
|
|
|
|
|
|
|
|
std::istream& input = (argc > 1 ? fin : std::cin);
|
2009-07-10 07:10:03 +04:00
|
|
|
try {
|
2009-07-10 08:25:11 +04:00
|
|
|
YAML::Parser parser(input);
|
|
|
|
while(parser) {
|
|
|
|
YAML::Node doc;
|
|
|
|
parser.GetNextDocument(doc);
|
|
|
|
}
|
2009-07-10 07:10:03 +04:00
|
|
|
} catch(const YAML::Exception& e) {
|
2009-07-10 08:17:30 +04:00
|
|
|
std::cerr << e.what() << "\n";
|
2009-07-10 07:10:03 +04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|