]> git.mxchange.org Git - flightgear.git/blobdiff - Polygon/names.cxx
Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
[flightgear.git] / Polygon / names.cxx
index 7e6d2a320e5f002142823a77ea8a6917fb7a53ae..eabd8697efcd9beb2fb554d5457460f7219843c4 100644 (file)
 #include "names.hxx"
 
 
-// return the type of the shapefile record
-AreaType get_shapefile_type(GDBFile *dbf, int rec) {
-    // GDBFieldDesc *fdesc[128];       // 128 is an arbitrary number here
-    GDBFValue *fields;         //an array of field values
-    char* dbf_rec;             //a record containing all the fields
-
-    // grab the meta-information for all the fields
-    // this applies to all the records in the DBF file.
-    // for ( int i = 0; i < dbf->numFields(); i++ ) {
-    //   fdesc[i] = dbf->getFieldDesc(i);
-    //   cout << i << ") " << fdesc[i]->name << endl;
-    // }
-
-    // this is the whole name record
-    dbf_rec = dbf->getRecord( rec );
-
-    // parse it into individual fields
-    if ( dbf_rec ) {
-       fields = dbf->recordDeform( dbf_rec );
-    } else {
-       return UnknownArea;
-    }
-
-    string area = fields[4].str_v;
-    // strip leading spaces
-    while ( area[0] == ' ' ) {
-       area = area.substr(1, area.length() - 1);
-    }
-    // strip trailing spaces
-    while ( area[area.length() - 1] == ' ' ) {
-       area = area.substr(0, area.length() - 1);
-    }
-    // strip other junk encountered
-    while ( (int)area[area.length() - 1] == 9 ) {
-       area = area.substr(0, area.length() - 1);
-    }
-
-    return get_area_type( area );
-}
-
-
 // return area type from text name
 AreaType get_area_type( string area ) {
     if ( area == "AirportKeep" ) {
@@ -151,6 +110,10 @@ string get_area_name( AreaType area ) {
 
 
 // $Log$
+// Revision 1.5  1999/03/22 23:49:29  curt
+// Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
+// belongs in ShapeFile/
+//
 // Revision 1.4  1999/03/13 18:47:04  curt
 // Removed an unused variable.
 //