32int main (
int argc,
char** argv)
37 std::cerr <<
"usage: " << argv[0] <<
" <v2.4 file> <v3.0 file>"
43 std::fstream in(argv[1], std::ios::in|std::ios::binary);
45 std::cerr <<
"File `" << argv[1] <<
"' does not exist?!" << std::endl;
49 std::fstream out(argv[2], std::ios::out|std::ios::binary);
51 std::cerr <<
"Cannot write to `" << argv[1] <<
"?!" << std::endl;
60 if (!(next_fragment(in, fragment,
MAX_ROS_SIZE*4)))
break;
69 std::cerr <<
" !! WARNING: found ROS fragment with format version = "
71 if (ex.
current() != MAJOR_DEFAULT_VERSION) {
72 std::cerr <<
" -> I cannot cope with this format. Skipping..."
77 std::cout <<
" -> ROS fragment will be simply copied..." << std::endl;
81 std::cerr <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
82 std::cerr <<
" -> Trying to continue..."
87 std::cerr << std::endl <<
"Uncaught unknown exception" << std::endl;
96 <<
"] -> [" <<
HEX(0x03000000) <<
"]" << std::endl;
103 std::cerr <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
104 std::cerr <<
" -> Trying to continue..."
110 std::cerr <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
115 catch (std::exception& ex) {
116 std::cerr <<
"Uncaught std exception: " << ex.
what() << std::endl;
122 std::cerr << std::endl <<
"Uncaught unknown exception" << std::endl;
127 out.write(
reinterpret_cast<char*
>(nfragment),
128 sizeof(uint32_t)*nfragment[1]);
130 std::cout <<
" -> (new) ROS fragment #" << l1id
131 <<
" converted, checked and saved."