* Interface for textures, sounds, and other types of resources.
*/
-#include <stdexcept>
#include <string>
#include <vector>
class Resource
{
public:
- struct Exception : public std::runtime_error
- {
- explicit Exception(const std::string& what_arg) :
- std::runtime_error(what_arg) {}
- };
- virtual ~Resource();
+ virtual ~Resource() {}
/**
* @param directory Path to a directory.
*/
- static void addSearchPath(const std::string& directory);
+ static void addSearchPaths(const std::string& path);
+ static void addSearchPaths(const std::vector<std::string>& path);
/**
* Get the path to a resource of a given name.
* @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);
private:
- static std::vector<std::string> searchPaths_;
+
+ static std::vector<std::string> gSearchPaths;
};