]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/fixlist.cxx
Fix line endings
[flightgear.git] / src / Navaids / fixlist.cxx
index f22fa57fb709d56e2d27aa39d0329d02d727d596..f33665bf6bed11974b278493fbfcfa8fdf23abca 100644 (file)
@@ -47,7 +47,6 @@ FGFixList::~FGFixList( void ) {
 
 // load the navaids and build the map
 bool FGFixList::init( SGPath path ) {
-
     fixlist.erase( fixlist.begin(), fixlist.end() );
 
     sg_gzifstream in( path.str() );
@@ -83,7 +82,6 @@ bool FGFixList::init( SGPath path ) {
         fixlist[fix.get_ident()] = fix;
         in >> skipcomment;
     }
-    
     return true;
 }
 
@@ -120,3 +118,18 @@ bool FGFixList::query_and_offset( const string& ident, double lon, double lat,
     *dist = s;
     return true;
 }
+
+const FGFix* FGFixList::findFirstByIdent( const string& ident, bool exact)
+{
+    fix_map_iterator itr;
+    if(exact) {
+        itr = fixlist.find(ident);
+    } else {
+        itr = fixlist.lower_bound(ident);
+    }
+    if(itr == fixlist.end()) {
+        return(NULL);
+    } else {
+        return(&(itr->second));
+    }
+}