-// save the data in gdbm format
-bool FGRunwaysUtil::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_StringProp pRwy ("Rwy");
- c4_FloatProp pLon ("Longitude");
- c4_FloatProp pLat ("Latitude");
- c4_FloatProp pHdg ("Heading");
- c4_FloatProp pLen ("Length");
- c4_FloatProp pWid ("Width");
- c4_StringProp pSurf ("SurfaceFlags");
- c4_StringProp pEnd1 ("End1Flags");
- c4_StringProp pEnd2 ("End2Flags");
-
- // Start with an empty view of the proper structure.
- c4_View vRunway =
- storage.GetAs("runway[ID:S,Rwy:S,Longitude:F,Latitude:F,Heading:F,Length:F,Width:F,SurfaceFlags:S,End1Flags:S,End2Flags:S]");
-
- c4_Row row;
-
- iterator current = runways.begin();
- const_iterator end = runways.end();
- while ( current != end ) {
- // add each runway record
- pID (row) = current->id.c_str();
- pRwy (row) = current->rwy_no.c_str();
- pLon (row) = current->lon;
- pLat (row) = current->lat;
- pHdg (row) = current->heading;
- pLen (row) = current->length;
- pWid (row) = current->width;
- pSurf (row) = current->surface_flags.c_str();
- pEnd1 (row) = current->end1_flags.c_str();
- pEnd2 (row) = current->end2_flags.c_str();
- vRunway.Add(row);
-
- ++current;
- }
-
- // commit our changes
- storage.Commit();
-
- return true;
-}
-