Changeset 11096 in ntrip for trunk/BNC/src/pppCrdFile.cpp
- Timestamp:
- Oct 16, 2026, 3:37:24 PM (2 hours ago)
- File:
-
- 1 edited
-
trunk/BNC/src/pppCrdFile.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/pppCrdFile.cpp
r11027 r11096 43 43 #include <cstdlib> 44 44 #include <fstream> 45 #include <locale> 45 46 #include <sstream> 46 47 #include "pppCrdFile.h" … … 63 64 double sign = (d < 0.0) ? -1.0 : 1.0; 64 65 return sign * (fabs(d) + m / 60.0 + s / 3600.0); 66 } 67 68 // Convert a number token independent of the process locale: atof() follows 69 // LC_NUMERIC, which Qt sets from the environment, so with e.g. a German 70 // locale "123.7785" would be read as 123. 71 ////////////////////////////////////////////////////////////////////////////// 72 static double toDouble(const string& str) { 73 istringstream in(str); 74 in.imbue(locale::classic()); 75 double value = 0.0; 76 in >> value; 77 return value; 65 78 } 66 79 … … 133 146 } 134 147 else if (token.compare(0, 2, "H:") == 0) { 135 hgt = atof(token.substr(2).c_str());148 hgt = toDouble(token.substr(2)); 136 149 haveHgt = true; 137 150 } 138 151 else if (token.compare(0, 6, "EPOCH:") == 0) { 139 staInfo._epoch = atof(token.substr(6).c_str());152 staInfo._epoch = toDouble(token.substr(6)); 140 153 } 141 154 else if (token.compare(0, 4, "VEL:") == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
