Merged r366:387 from the jbeder-event-api branch

This commit is contained in:
Jesse Beder
2010-10-18 06:45:03 +00:00
parent 0a02403fb0
commit a71c03a18b
35 changed files with 1280 additions and 634 deletions

View File

@@ -1,9 +1,25 @@
#include "yaml.h"
#include <fstream>
#include <iostream>
#include <vector>
struct Params {
bool hasFile;
std::string fileName;
};
Params ParseArgs(int argc, char **argv) {
Params p;
std::vector<std::string> args(argv + 1, argv + argc);
return p;
}
int main(int argc, char **argv)
{
Params p = ParseArgs(argc, argv);
std::ifstream fin;
if(argc > 1)
fin.open(argv[1]);
@@ -13,9 +29,9 @@ int main(int argc, char **argv)
YAML::Parser parser(input);
YAML::Node doc;
while(parser.GetNextDocument(doc)) {
YAML::Emitter emitter;
emitter << doc;
std::cout << emitter.c_str() << "\n";
// YAML::Emitter emitter;
// emitter << doc;
// std::cout << emitter.c_str() << "\n";
}
} catch(const YAML::Exception& e) {
std::cerr << e.what() << "\n";