* Interface for textures, sounds, and other types of resources.
*/
-#include <stdexcept>
#include <string>
#include <vector>
+#include <Moof/Exception.hh>
+
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();
* @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_;
};