#include <cstdlib>
#include <fstream>
#include <iostream>
#include "eformat/eformat.h"
#include "eformat/old/eformat.h"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Reads a file and check its validity (for the time being)
Definition at line 31 of file check-old.cxx.
31 {
33
34 if ( argc != 2 )
35 {
36 std::cerr << "usage: " << argv[0] << " <file>" << std::endl;
37 std::exit( 1 );
38 }
39
40
41 std::fstream in( argv[1], std::ios::in | std::ios::binary );
42 if ( !in )
43 {
44 std::cerr << "File `" << argv[1] << "' does not exist?!" << std::endl;
45 std::exit( 1 );
46 }
48
49 while ( true )
50 {
51
53
54 try
55 {
57
58 fe.check_tree();
59
60
61 std::cout << "Event " << fe.lvl1_id() << " is Ok." << std::endl;
63 {
64 std::cerr << std::endl <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
65 std::cout << "Trying to continue..." << std::endl;
66 continue;
68 {
69 std::cerr << std::endl <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
70 delete[] event;
71 std::exit( 1 );
72 } catch ( std::exception& ex )
73 {
74 std::cerr << std::endl << "Uncaught std exception: " << ex.what() << std::endl;
75 delete[] event;
76 std::exit( 1 );
77 } catch ( ... )
78 {
79 std::cerr << std::endl << "Uncaught unknown exception" << std::endl;
80 delete[] event;
81 std::exit( 1 );
82 }
83 }
84
85 delete[] event;
86 return 0;
87}
const size_t MAX_EVENT_SIZE
const char * what() const
Human description message.
◆ MAX_EVENT_SIZE
| const size_t MAX_EVENT_SIZE = 2500000 |