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  public:
15  FileManager();
16 
18  inline const std::string worldsRoot() const { return WorldsRoot; }
20  inline void newWorld( const std::string& worldfile ) {
21  WorldsRoot = stripFilename( 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  };
36 
37 };
38 #endif
static bool readable(const std::string &path)
Determine whether a file can be opened for reading.
Definition: file_manager.cc:68
The Stage library uses its own namespace.
Definition: canvas.hh:8
std::string WorldsRoot
Definition: file_manager.hh:11
void newWorld(const std::string &worldfile)
Update the worldfile path.
Definition: file_manager.hh:20
static std::string stagePath()
Return the STAGEPATH environment variable.
Definition: file_manager.cc:28
std::string stripFilename(const std::string &path)
Definition: file_manager.cc:80
static std::string findFile(const std::string &filename)
Definition: file_manager.cc:36
const std::string worldsRoot() const
Return the path where the current worldfile was loaded from.
Definition: file_manager.hh:18


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:09