X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FResource.hh;h=2740fc31a136add04d6bcc81f7a21ae37aa878bc;hp=f7d17824dc2c6d162cd8ff4c3ddb2d3a1971950d;hb=a31d65a998121df0651c57bfb68782e2a07d2e2f;hpb=31d52677b38d935297d132bdbd956c655cd3feee diff --git a/src/Moof/Resource.hh b/src/Moof/Resource.hh index f7d1782..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(); @@ -74,7 +70,20 @@ public: 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_; };