X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FResource.hh;h=2740fc31a136add04d6bcc81f7a21ae37aa878bc;hp=716e906e03f4c1f53d1ae0b3ba44ace3b3f3ba0b;hb=a31d65a998121df0651c57bfb68782e2a07d2e2f;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/Resource.hh b/src/Moof/Resource.hh index 716e906..2740fc3 100644 --- a/src/Moof/Resource.hh +++ b/src/Moof/Resource.hh @@ -34,10 +34,11 @@ * Interface for textures, sounds, and other types of resources. */ -#include #include #include +#include + namespace Mf { @@ -49,11 +50,6 @@ namespace Mf { class Resource { public: - struct Exception : public std::runtime_error - { - explicit Exception(const std::string& what_arg) : - std::runtime_error(what_arg) {} - }; virtual ~Resource(); @@ -72,9 +68,22 @@ public: * @return The first path found which resolves to a file. */ - static std::string getPathToResource(const std::string& name); + static std::string getPath(const std::string& name); + + + struct Exception : public Mf::Exception + { + explicit Exception(unsigned error) : + Mf::Exception(error) {} + + void raise() + { + throw *this; + } + }; private: + static std::vector searchPaths_; };