X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FResource.cc;h=ff4213ec7d3e04e877704a949313f72f00df2e84;hp=a9ff22da9eb68c1300055fca4337bbcbf62d848e;hb=7f3984f3f9524f5b6813e01ceb2fe576dadff94e;hpb=8ad81a8282ce6e9e488a453e6bcd05fbc09715dc diff --git a/src/Moof/Resource.cc b/src/Moof/Resource.cc index a9ff22d..ff4213e 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 " << name << std::endl; + // empty string return std::string(); }