30 {
32
33 if ( argc != 2 )
34 {
35 std::cerr << "usage: " << argv[0] << " <file>" << std::endl;
36 std::exit( 1 );
37 }
38
39
40 std::fstream in( argv[1], std::ios::in | std::ios::binary );
41 if ( !in )
42 {
43 std::cerr << "File `" << argv[1] << "' does not exist?!" << std::endl;
44 std::exit( 1 );
45 }
47 uint32_t sevent = 0;
48 while ( in.good() && !in.eof() && sevent != 0xaa1234aa ) { in.read( (char*)&sevent, 4 ); }
49 if ( sevent == 0xaa1234aa ) in.seekg( in.tellg() - (std::streampos)4 );
50 else exit( 1 );
51
52
53
54
55
56 while ( true )
57 {
58
60
61 try
62 {
64 fe.check_tree();
65
66 std::cout << "Event " << fe.lvl1_id() << " is Ok." << std::endl;
68 {
69 std::cerr << std::endl <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
70 std::cout << "Trying to continue..." << std::endl;
71 continue;
73 {
74 std::cerr << std::endl <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
75 delete[] event;
76 std::exit( 1 );
77 } catch ( std::exception& ex )
78 {
79 std::cerr << std::endl << "Uncaught std exception: " << ex.what() << std::endl;
80 delete[] event;
81 std::exit( 1 );
82 } catch ( ... )
83 {
84 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
85 delete[] event;
86 std::exit( 1 );
87 }
88 }
89
90 delete[] event;
91 return 0;
92}
const size_t MAX_EVENT_SIZE
const char * what() const
Human description message.