| 92 | |
| 93 | template <template <class ResourceType> class LoaderType, class ResourceType> |
| 94 | inline LoaderResult Path::load(const LoaderType<ResourceType>& loader, |
| 95 | ResourceType& resource, bool allowFailure) const |
| 96 | { |
| 97 | for (const MountablePath& mountedPath : m_mounts) |
| 98 | { |
| 99 | std::string loadPath = mountedPath.basePath |
| 100 | + ((!mountedPath.basePath.empty()) ? "/" : "") + this->m_path; |
| 101 | if (Utils::File::fileExists(loadPath) |
| 102 | || Utils::File::directoryExists(loadPath)) |
| 103 | { |
| 104 | Debug::Log->debug("<Path> Loading resource at : {0}", loadPath); |
| 105 | if (loader.load(resource, loadPath)) |
| 106 | { |
| 107 | return LoaderResult(loadPath); |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | if (allowFailure) |
| 112 | return LoaderResult(); |
| 113 | else |
| 114 | throw Exceptions::ResourceNotFound( |
| 115 | m_path, MountablePath::StringPaths(), EXC_INFO); |
| 116 | } |
| 117 | |
| 118 | template <template <class ResourceType> class LoaderType, class ResourceType> |
| 119 | inline LoaderMultipleResult Path::loadAll(const LoaderType<ResourceType>& loader, |
no test coverage detected