00001 #pragma ident "$Id: rinex_met_read_write.cpp 1895 2009-05-12 19:34:29Z afarris $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #include "RinexMetBase.hpp"
00031 #include "RinexMetData.hpp"
00032 #include "RinexMetHeader.hpp"
00033 #include "RinexMetStream.hpp"
00034
00035 using namespace std;
00036
00039 main(int argc, char *argv[])
00040 {
00041 if (argc<3)
00042 {
00043 cout << "rinex_met_read_write inputfile outputfile" << endl;
00044 exit(-1);
00045 }
00046
00047 try
00048 {
00049 cout << "Reading " << argv[1] << endl;
00050 gpstk::RinexMetStream roffs(argv[1]);
00051 cout << "Writing " << argv[2] << endl;
00052 gpstk::RinexMetStream out(argv[2],ios::out);
00053
00054 gpstk::RinexMetHeader roh;
00055 gpstk::RinexMetData roe;
00056
00057
00058
00059 roffs >> roh;
00060 out << roh;
00061 roh.dump(cout);
00062
00063 while (roffs >> roe)
00064 {
00065 out << roe;
00066 }
00067
00068 cout << "done" << endl;
00069 exit(0);
00070 }
00071 catch(gpstk::Exception& e)
00072 {
00073 cout << e;
00074 exit(1);
00075 }
00076 catch (...)
00077 {
00078 cout << "unknown error. Done." << endl;
00079 exit(1);
00080 }
00081
00082 exit(0);
00083 }