file_manager.hh
Go to the documentation of this file.
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;
12 
13  std::string stripFilename(const std::string &path);
14 
15 public:
16  FileManager();
17 
19  inline const std::string worldsRoot() const { return WorldsRoot; }
21  void newWorld(const std::string &worldfile);
22 
24  static bool readable(const std::string &path);
25 
31  static std::string findFile(const std::string &filename);
32 
34  static std::string stagePath();
35 
37  static std::string homeDirectory();
38 };
39 }
40 #endif
Definition: file_manager.hh:9
FileManager()
Definition: file_manager.cc:27
const std::string worldsRoot() const
Return the path where the current worldfile was loaded from.
Definition: file_manager.hh:19
static bool readable(const std::string &path)
Determine whether a file can be opened for reading.
Definition: file_manager.cc:92
static std::string stagePath()
Return the STAGEPATH environment variable.
Definition: file_manager.cc:31
static std::string homeDirectory()
Returns the path to the current user's home directory (or empty if not detectable):
Definition: file_manager.cc:83
void newWorld(const std::string &worldfile)
Update the worldfile path.
Definition: file_manager.cc:72
static std::string findFile(const std::string &filename)
Definition: file_manager.cc:40
The Stage library uses its own namespace.
Definition: canvas.hh:8