13
fileExists(string &filename)
15
bool returnVal = false;
18
msg << "Looking for " << filename << " ... ";
19
ifstream f(filename.c_str());
32
Options *options = Options::getInstance();
33
if (options->Verbosity() > 2)
34
xpMsg(msg.str(), __FILE__, __LINE__);
40
findFile(string &filename, const string &subdir)
42
// Check if the file exists in the current directory before going
44
if (fileExists(filename)) return(true);
48
Options *options = Options::getInstance();
49
vector<string> searchdir = options->getSearchDir();
51
for (int i = searchdir.size() - 1; i >= 0; i--)
53
// Check in searchdir itself
54
newname = searchdir[i];
58
if (fileExists(newname))
64
// Now look in searchdir + subdir
65
newname = searchdir[i];
74
if (fileExists(newname))
81
string errMsg("Can't find ");
84
for (int i = searchdir.size() - 1; i >= 0; i--)
86
errMsg += searchdir[i];
91
xpWarn(errMsg, __FILE__, __LINE__);