std::vector<std::string> Resource::searchPaths_;
-Resource::~Resource() {}
-
-
void Resource::addSearchPath(const std::string& directory)
{
std::string path(directory);
path += '/';
}
-#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
+#if defined(_WIN32) || defined(__WIN32__)
boost::replace_all(path, "/", "\\");
#endif
std::string path(name);
-#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
+#if defined(_WIN32) || defined(__WIN32__)
boost::replace_all(path, "/", "\\");
#endif
std::string fullPath(*it);
fullPath += path;
- logDebug("looking for resource %s at %s", name.c_str(), path.c_str());
-
- if (access(fullPath.c_str(), R_OK) == 0)
- {
- logDebug("found resource %s at %s", name.c_str(), path.c_str());
- return fullPath;
- }
+ if (access(fullPath.c_str(), R_OK) == 0) return fullPath;
}
+ logWarning("cannot find resource %s", name.c_str());
+
// empty string
return std::string();
}