- SGPath rwyPrefPath( globals->get_fg_root() );
- rwyPrefPath.append( "AI/Airports/" );
- rwyPrefPath.append( p->getId() );
- rwyPrefPath.append( "rwyuse.xml" );
+bool XMLLoader::findAirportData(const std::string& aICAO,
+ const std::string& aFileName, SGPath& aPath)
+{
+ string fileName(aFileName);
+ if (!simgear::strutils::ends_with(aFileName, ".xml")) {
+ fileName.append(".xml");
+ }
+
+ string_list sc = globals->get_fg_scenery();
+ char buffer[128];
+ ::snprintf(buffer, 128, "%c/%c/%c/%s.%s",
+ aICAO[0], aICAO[1], aICAO[2],
+ aICAO.c_str(), fileName.c_str());