// $Id$
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
+
+#include <simgear/logstream.hxx>
+#include <simgear/fgpath.hxx>
+#include <simgear/fgstream.hxx>
-#include <Debug/logstream.hxx>
-#include <Misc/fgstream.hxx>
#include <Main/options.hxx>
#include STL_STRING
fgAIRPORT a;
// build the path name to the airport file
- string path = current_options.get_fg_root() + "/Airports/" + file;
+ FGPath path( current_options.get_fg_root() );
+ path.append( "Airports" );
+ path.append( file );
airports.erase( airports.begin(), airports.end() );
- fg_gzifstream in( path );
- if ( !in ) {
- FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path );
+ fg_gzifstream in( path.str() );
+ if ( !in.is_open() ) {
+ FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() );
exit(-1);
}
*/
// read in each line of the file
+
+#ifdef __MWERKS__
+
in >> skipcomment;
- while ( ! in.eof() )
- {
+ char c = 0;
+ while ( in.get(c) && c != '\0' ) {
+ in.putback(c);
+ in >> a;
+ airports.insert(a);
+ in >> skipcomment;
+ }
+
+#else
+
+ in >> skipcomment;
+ while ( ! in.eof() ) {
in >> a;
airports.insert(a);
in >> skipcomment;
}
+#endif
+
return 1;
}