#include <unistd.h>
-#include "resource.hh"
+#include "Resource.hh"
-namespace dc {
+namespace Mf {
-std::vector<std::string> resource::searchPaths_;
+// static member
+std::vector<std::string> Resource::searchPaths_;
-resource::~resource() {}
+Resource::~Resource() {}
-void resource::addSearchPath(const std::string& directory)
+void Resource::addSearchPath(const std::string& directory)
{
// add a slash if there isn't one already
if (directory[directory.length() - 1] != '/')
}
}
-std::string resource::getPathToResource(const std::string& name)
+std::string Resource::getPathToResource(const std::string& name)
{
- std::vector<std::string>::iterator i;
+ std::vector<std::string>::iterator it;
- for (i = searchPaths_.begin(); i != searchPaths_.end(); i++)
+ for (it = searchPaths_.begin(); it != searchPaths_.end(); it++)
{
- std::string fullPath(*i);
+ std::string fullPath(*it);
fullPath += name;
- // TODO access(2) is not all that portable
+ // TODO this could be more portable
if (access(fullPath.c_str(), R_OK) == 0)
{
return fullPath;
}
-} // namespace dc
+} // namespace Mf
/** vim: set ts=4 sw=4 tw=80: *************************************************/