-// save the data in gdbm format
-bool FGAirportsUtil::dump_mk4( const string& file ) {
-
- // open database for writing
- c4_Storage storage( file.c_str(), true );
-
- // need to do something about error handling here!
-
- // define the properties
- c4_StringProp pID ("ID");
- c4_FloatProp pLon ("Longitude");
- c4_FloatProp pLat ("Latitude");
- c4_FloatProp pElev ("Elevation");
-
- // Start with an empty view of the proper structure.
- c4_View vAirport =
- storage.GetAs("airport[ID:S,Longitude:F,Latitude:F,Elevation:F]");
-
- c4_Row row;
-
- iterator current = airports.begin();
- const_iterator end = airports.end();
- while ( current != end ) {
- // add each airport record
- pID (row) = current->id.c_str();
- pLon (row) = current->longitude;
- pLat (row) = current->latitude;
- pElev (row) = current->elevation;
- vAirport.Add(row);
-
- ++current;
- }
-
- // commit our changes
- storage.Commit();
-
- return true;