source: ntrip/trunk/BNC/src/pppCrdFile.cpp@ 7151

Last change on this file since 7151 was 6050, checked in by mervart, 10 years ago
File size: 2.6 KB
Line 
1
2// Part of BNC, a utility for retrieving decoding and
3// converting GNSS data streams from NTRIP broadcasters.
4//
5// Copyright (C) 2007
6// German Federal Agency for Cartography and Geodesy (BKG)
7// http://www.bkg.bund.de
8// Czech Technical University Prague, Department of Geodesy
9// http://www.fsv.cvut.cz
10//
11// Email: euref-ip@bkg.bund.de
12//
13// This program is free software; you can redistribute it and/or
14// modify it under the terms of the GNU General Public License
15// as published by the Free Software Foundation, version 2.
16//
17// This program is distributed in the hope that it will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU General Public License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with this program; if not, write to the Free Software
24// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26/* -------------------------------------------------------------------------
27 * BKG NTRIP Client
28 * -------------------------------------------------------------------------
29 *
30 * Class: t_pppCrdFile
31 *
32 * Purpose: Read a priori coordinate file
33 *
34 * Author: L. Mervart
35 *
36 * Created: 29-Jul-2014
37 *
38 * Changes:
39 *
40 * -----------------------------------------------------------------------*/
41
42#include <fstream>
43#include <sstream>
44#include "pppCrdFile.h"
45#include "bncutils.h"
46
47using namespace std;
48using namespace BNC_PPP;
49
50//
51//////////////////////////////////////////////////////////////////////////////
52void t_pppCrdFile::readCrdFile(const string& fileName, vector<t_staInfo>& staInfoVec) {
53
54 staInfoVec.clear();
55
56 ifstream inFile(fileName.c_str());
57 while (inFile.good()) {
58 string line; getline(inFile,line);
59 stripWhiteSpace(line);
60 if ( line.empty() || line[0] == '#'|| line[0] == '!') {
61 continue;
62 }
63
64 istringstream in;
65
66 t_staInfo staInfo;
67
68 size_t q1 = line.find('"');
69 if (q1 != string::npos) {
70 size_t q2 = line.find('"', q1+1);
71 if (q2 == string::npos) {
72 continue;
73 }
74 staInfo._name = line.substr(q1+1, q2-q1-1);
75 in.str(line.substr(q2+1));
76 }
77 else {
78 in.str(line);
79 in >> staInfo._name;
80 }
81
82 in >> staInfo._xyz(1) >> staInfo._xyz(2) >> staInfo._xyz(3);
83
84 if (!in.eof()) {
85 in >> staInfo._neuAnt(1) >> staInfo._neuAnt(2) >> staInfo._neuAnt(3);
86 }
87
88 if (!in.eof()) {
89 getline(in, staInfo._antenna);
90 stripWhiteSpace(staInfo._antenna);
91 }
92
93 staInfoVec.push_back(staInfo);
94 }
95}
Note: See TracBrowser for help on using the repository browser.