]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Resource.hh
minor refactoring and state progress
[chaz/yoink] / src / Moof / Resource.hh
index 716e906e03f4c1f53d1ae0b3ba44ace3b3f3ba0b..2740fc31a136add04d6bcc81f7a21ae37aa878bc 100644 (file)
  * Interface for textures, sounds, and other types of resources.
  */
 
-#include <stdexcept>
 #include <string>
 #include <vector>
 
+#include <Moof/Exception.hh>
+
 
 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<std::string> searchPaths_;
 };
 
This page took 0.018954 seconds and 4 git commands to generate.