Skip to content
Newer
Older
100644 39 lines (29 sloc) 1.01 KB
fad94f6 Implemented FileManager class to help with resource locating
jeremy_asher authored Jun 12, 2008
1 #ifndef _FILE_MANAGER_HH_
2 #define _FILE_MANAGER_HH_
3
4 #include <string>
5 #include <vector>
6
7 namespace Stg {
8
9 class FileManager {
10 private:
11 std::string WorldsRoot;
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
12
f8cd77b @rtv fixed various small things spotted by cppcheck
authored Aug 13, 2011
13 std::string stripFilename( const std::string& path );
fad94f6 Implemented FileManager class to help with resource locating
jeremy_asher authored Jun 12, 2008
14 public:
15 FileManager();
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
16
17 /// Return the path where the current worldfile was loaded from
fad94f6 Implemented FileManager class to help with resource locating
jeremy_asher authored Jun 12, 2008
18 inline const std::string worldsRoot() const { return WorldsRoot; }
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
19 /// Update the worldfile path
f8cd77b @rtv fixed various small things spotted by cppcheck
authored Aug 13, 2011
20 inline void newWorld( const std::string& worldfile ) {
fad94f6 Implemented FileManager class to help with resource locating
jeremy_asher authored Jun 12, 2008
21 WorldsRoot = stripFilename( worldfile ); }
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
22
23 /// Determine whether a file can be opened for reading
f8cd77b @rtv fixed various small things spotted by cppcheck
authored Aug 13, 2011
24 static bool readable( const std::string& path );
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
25
26 /** Search for a file in the current directory, in the
27 * prefix/share/stage location, and in the locations specified by
28 * the STAGEPATH environment variable. Returns the first match or
29 * the original filename if not found.
30 **/
f8cd77b @rtv fixed various small things spotted by cppcheck
authored Aug 13, 2011
31 static std::string findFile( const std::string& filename );
139ea99 stage: major FileManager updates, rgb.txt is now searched for in STAG…
jeremy_asher authored Aug 1, 2008
32
33 /// Return the STAGEPATH environment variable
34 static std::string stagePath();
fad94f6 Implemented FileManager class to help with resource locating
jeremy_asher authored Jun 12, 2008
35 };
36
37 };
38 #endif
Something went wrong with that request. Please try again.