]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Airports / simple.cxx
index 6c0911a0c906d1a502267ba4cb4d437e26d7efb9..8d02279ab7eb7605618bea94ffb8deb25fdcde8e 100644 (file)
@@ -40,9 +40,7 @@
 #include <simgear/compiler.h>
 
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgstream.hxx>
-
-#include <Main/options.hxx>
+#include <simgear/misc/sgstream.hxx>
 
 #include STL_STRING
 #include STL_FUNCTIONAL
 
 #include "simple.hxx"
 
-FG_USING_NAMESPACE(std);
+SG_USING_NAMESPACE(std);
 
 FGAirports::FGAirports( const string& file ) {
     // open the specified database readonly
     storage = new c4_Storage( file.c_str(), false );
 
     if ( !storage->Strategy().IsValid() ) {
-       FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file );
+       SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file );
        exit(-1);
     }
 
@@ -104,7 +102,7 @@ FGAirports::search( const string& id ) const
 
 // Destructor
 FGAirports::~FGAirports( void ) {
-    // gdbm_close( dbf );
+    delete storage;
 }
 
 
@@ -119,9 +117,9 @@ int FGAirportsUtil::load( const string& file ) {
 
     airports.erase( airports.begin(), airports.end() );
 
-    fg_gzifstream in( file );
+    sg_gzifstream in( file );
     if ( !in.is_open() ) {
-       FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << file );
+       SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file );
        exit(-1);
     }
 
@@ -194,7 +192,7 @@ bool FGAirportsUtil::dump_mk4( const string& file ) {
 
     c4_Row row;
 
-    iterator current = airports.begin();
+    const_iterator current = airports.begin();
     const_iterator end = airports.end();
     while ( current != end ) {
        // add each airport record