]>
Dogcows Code - chaz/yoink/blob - src/Moof/Resource.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _MOOF_RESOURCE_HH_
13 #define _MOOF_RESOURCE_HH_
17 * Interface for textures, sounds, and other types of resources.
29 * Generic resource class.
36 virtual ~Resource() {}
40 * Add a directory to search when looking for resource files.
41 * @param directory Path to a directory.
44 static void addSearchPaths(const std::string
& paths
);
45 static void addSearchPaths(const std::vector
<std::string
>& pathList
);
48 * Get the path to a resource of a given name.
49 * @param name Name of a resource. The name will be appended to each
50 * search directory in order.
51 * @return The first path found which resolves to a file.
54 static std::string
getPath(const std::string
& path
,
55 const std::string
& prefix
= "",
56 const std::string
& extension
= "");
58 static bool getPath(std::string
& path
,
59 const std::string
& prefix
= "",
60 const std::string
& extension
= "");
62 static FILE* openFile(std::string
& path
,
63 std::string prefix
= "",
64 const std::string
& extension
= "",
65 const std::string
& mode
= "rb");
69 static std::vector
<std::string
> gSearchPaths
;
75 #endif // _MOOF_RESOURCE_HH_
This page took 0.037913 seconds and 4 git commands to generate.