+string FGFCS::FindSystemFullPathname(string system_filename)
+{
+ string fullpath, localpath;
+ string systemPath = FDMExec->GetSystemsPath();
+ string aircraftPath = FDMExec->GetFullAircraftPath();
+ ifstream system_file;
+
+ string separator = "/";
+
+ fullpath = systemPath + separator;
+ localpath = aircraftPath + separator + "Systems" + separator;
+
+ system_file.open(string(fullpath + system_filename + ".xml").c_str());
+ if ( !system_file.is_open()) {
+ system_file.open(string(localpath + system_filename + ".xml").c_str());
+ if ( !system_file.is_open()) {
+ cerr << " Could not open system file: " << system_filename << " in path "
+ << fullpath << " or " << localpath << endl;
+ return string("");
+ } else {
+ return string(localpath + system_filename + ".xml");
+ }
+ }
+ return string(fullpath + system_filename + ".xml");
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ifstream* FGFCS::FindSystemFile(string system_filename)
+{
+ string fullpath, localpath;
+ string systemPath = FDMExec->GetSystemsPath();
+ string aircraftPath = FDMExec->GetFullAircraftPath();
+ ifstream* system_file = new ifstream();
+
+ string separator = "/";
+
+ fullpath = systemPath + separator;
+ localpath = aircraftPath + separator + "Systems" + separator;
+
+ system_file->open(string(fullpath + system_filename + ".xml").c_str());
+ if ( !system_file->is_open()) {
+ system_file->open(string(localpath + system_filename + ".xml").c_str());
+ if ( !system_file->is_open()) {
+ cerr << " Could not open system file: " << system_filename << " in path "
+ << fullpath << " or " << localpath << endl;
+ }
+ }
+ return system_file;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+