"library/src/profiler/profile_conv_bwd_data.cpp" did not exist on "acbd7bd7c5efd17b7061157a5868e28acc04d33e"
parse.cpp 471 Bytes
Newer Older
1
2
3
4
5
6
#include "yaml.h"
#include <fstream>
#include <iostream>

int main(int argc, char **argv)
{
7
8
9
10
11
	std::ifstream fin;
	if(argc > 1)
		fin.open(argv[1]);
	
	std::istream& input = (argc > 1 ? fin : std::cin);
12
	try {
13
		YAML::Parser parser(input);
14
15
		YAML::Node doc;
		while(parser.GetNextDocument(doc)) {
16
17
18
			YAML::Emitter emitter;
			emitter << doc;
			std::cout << emitter.c_str() << "\n";
19
		}
20
	} catch(const YAML::Exception& e) {
21
		std::cerr << e.what() << "\n";
22
23
24
	}
	return 0;
}