X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FResource.cc;h=6f09601bf0d36d07f0dc820523e388ed13334868;hp=a9ff22da9eb68c1300055fca4337bbcbf62d848e;hb=8a1acac01b444dccf8b57cedf08392ada2e473c1;hpb=bffc879fc8ee8167bb123310d39fad4e2f426ffd diff --git a/src/Moof/Resource.cc b/src/Moof/Resource.cc index a9ff22d..6f09601 100644 --- a/src/Moof/Resource.cc +++ b/src/Moof/Resource.cc @@ -41,9 +41,6 @@ namespace Mf { std::vector Resource::searchPaths_; -Resource::~Resource() {} - - void Resource::addSearchPath(const std::string& directory) { std::string path(directory); @@ -56,7 +53,7 @@ void Resource::addSearchPath(const std::string& directory) path += '/'; } -#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64) +#if defined(_WIN32) || defined(__WIN32__) boost::replace_all(path, "/", "\\"); #endif @@ -69,7 +66,7 @@ std::string Resource::getPath(const std::string& name) std::string path(name); -#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64) +#if defined(_WIN32) || defined(__WIN32__) boost::replace_all(path, "/", "\\"); #endif @@ -78,15 +75,11 @@ std::string Resource::getPath(const std::string& name) 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(); }