00001 #pragma ident "$Id: rinex_nav_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 "RinexNavBase.hpp"
00031 #include "RinexNavData.hpp"
00032 #include "RinexNavHeader.hpp"
00033 #include "RinexNavStream.hpp"
00034
00035 using namespace std;
00036
00038 main(int argc, char *argv[])
00039 {
00040 if (argc<2)
00041 {
00042 cout << "rinex_nav_read_write inputfile outputfile" << endl;
00043 exit(-1);
00044 }
00045
00046 try
00047 {
00048 cout << "Reading " << argv[1] << endl;
00049 gpstk::RinexNavStream rnffs(argv[1]);
00050 cout << "Writing " << argv[2] << endl;
00051 gpstk::RinexNavStream out(argv[2], ios::out);
00052 gpstk::RinexNavHeader rnh;
00053 gpstk::RinexNavData rne;
00054
00055 rnffs >> rnh;
00056 out << rnh;
00057 rnh.dump(cout);
00058
00059 int i = 0;
00060 while (rnffs >> rne)
00061 {
00062 out << rne;
00063 i++;
00064 }
00065
00066 cout << "Read " << i << " records. Done." << endl;
00067 exit(0);
00068 }
00069 catch(gpstk::Exception& e)
00070 {
00071 cout << e;
00072 exit(1);
00073 }
00074 catch (...)
00075 {
00076 cout << "unknown error. Done." << endl;
00077 exit(1);
00078 }
00079
00080 exit(0);
00081 }