]> git.mxchange.org Git - flightgear.git/commitdiff
Upgraded to handle new default.apt.gz file.
authorcurt <curt>
Tue, 3 Jul 2001 16:44:37 +0000 (16:44 +0000)
committercurt <curt>
Tue, 3 Jul 2001 16:44:37 +0000 (16:44 +0000)
src/Airports/gensimple.cxx
src/Airports/runways.cxx
src/Airports/simple.cxx

index f3c9a9757d96fbf1197879feab2c82ece15d2e2d..db67d61f69d39a82c31f641107e376f7568dc891 100644 (file)
@@ -1,11 +1,15 @@
 // dump out a gdbm version of the simple airport file
 
+#include <simgear/debug/logstream.hxx>
+
 #include "simple.hxx"
 
 int main( int argc, char **argv ) {
     FGAirportsUtil airports;
     FGAirport a;
 
+    sglog().setLogLevels( SG_ALL, SG_INFO );
+
     if ( argc == 3 ) {
        airports.load( argv[1] );
        airports.dump_mk4( argv[2] );    
index 89ca91e684a6c9b7b1e730959d769cabcd85ef2f..2db4a7fade8f1429f6a3f5ec5ace633478f03ac7 100644 (file)
@@ -232,8 +232,8 @@ int FGRunwaysUtil::load( const string& file ) {
     }
 
     // skip first line of file
-    char tmp[256];
-    in.getline( tmp, 256 );
+    char tmp[2048];
+    in.getline( tmp, 2048 );
 
     // read in each line of the file
 
index 8d02279ab7eb7605618bea94ffb8deb25fdcde8e..3f02a796ddac5e5cc4025544878815750f2c124b 100644 (file)
@@ -121,12 +121,13 @@ int FGAirportsUtil::load( const string& file ) {
     if ( !in.is_open() ) {
        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file );
        exit(-1);
+    } else {
+       SG_LOG( SG_GENERAL, SG_ALERT, "opened: " << file );
     }
 
     // skip first line of file
-    char tmp[256];
-    in.getline( tmp, 256 );
-
+    char tmp[2048];
+    in.getline( tmp, 2048 );
 
     // read in each line of the file
 
@@ -137,6 +138,7 @@ int FGAirportsUtil::load( const string& file ) {
     while ( in.get(c) && c != '\0' ) {
        if ( c == 'A' ) {
            in >> a;
+            SG_LOG( SG_GENERAL, SG_INFO, a.id );
            in >> skipeol;
            airports.insert(a);
        } else if ( c == 'R' ) {
@@ -150,15 +152,15 @@ int FGAirportsUtil::load( const string& file ) {
 #else
 
     in >> ::skipws;
+    string token;
     while ( ! in.eof() ) {
-       char c = 0;
-       in.get(c);
-       if ( c == 'A' ) {
+       in >> token;
+       if ( token == "A" ) {
            in >> a;
-           cout << "in <- " << a.id << endl;
+            SG_LOG( SG_GENERAL, SG_INFO, "in <- " << a.id );
            in >> skipeol;
            airports.insert(a);
-       } else if ( c == 'R' ) {
+       } else if ( token == "R" ) {
            in >> skipeol;
        } else {
            in >> skipeol;