This will avoid problems in case stampCacheFile() or
isCachedFileModified() is passed a relative path, or a path containing
.. components, etc. Among others, it ensures the stat_cache table only
contains absolute paths.
NavDataCache: read and write methods preserving order for string list props
New methods: NavDataCache::readOrderedStringListProperty() and
NavDataCache::writeOrderedStringListProperty().
add missing includes; proper interface for the APTLoader class
remove unused members 'last_apt_info' and 'token'
The APTLoader methods defined in src/Airports/apt_loader.cxx are now at
top level instead of being inside a 'class' definition block, therefore
they don't have to be indented anymore.
APTLoader::throwExceptionIfStreamError(): better API and implementation
- loadFixes() becomes FixesLoader::loadFixes();
- the previous 'cache' variable (NavDataCache *) is now a private member
of FixesLoader, named '_cache'.
- Line numbering was incorrect, because "in >> lat >> lon >> ident;"
happily skipped over blank lines without increasing the line number.
- Safe stream input handling: first, std::getline() tries to read data,
then we check whether that was successful (via the input stream's
bool() method, implicitly called in the 'for' loop's exit check), and
only if this is the case, we process the data that was read. The main
problem with the previous code is that checking the stream's eofbit
can't possibly predict whether a _future_ read will be successful---it
may fail due to an I/O error, at least.
- Currently, the code uses atof() to parse the latitude and longitude
fields. This should be fast, though not good at detecting errors in
the input; however, this is not worse than the previous code which
didn't handle such cases at all.
- Correctly deal with input lines containing a number of fields
different from 3 (except for the header and the special '99' line):
log a warning, ignore the line and continue. This adresses the problem
described in
<https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/87shydeen1.fsf%40frougon.crabdance.com/#msg35034274>.
In short, the previous code entered an endless loop trying to process
31.815914 -106.281897 EL PA
from recent earth_fix.dat
(obtained from <http://gateway.x-plane.com/navaids/LatestNavFix.zip>).
Expand existing —-config option to read either property-XML files (as
it previously did) but for non-XML files, to parse them as command
line argument files.
Bypass the options system to set location from the launcher; this
allows the same code to be used in-sim for repositioning, while
keeping compatibility with other repositions approaches.
With Simgear commit d7d59b08a2f1a77a4247ec1a89d6ff48ed73f5c7, this
allows terrasync to be initialised from files in the install data,
which avoids downloading them again.