#include <file_manager.hh>
Public Member Functions | |
FileManager () | |
void | newWorld (const std::string &worldfile) |
Update the worldfile path. | |
const std::string | worldsRoot () const |
Return the path where the current worldfile was loaded from. | |
Static Public Member Functions | |
static std::string | findFile (const std::string &filename) |
static bool | readable (const std::string &path) |
Determine whether a file can be opened for reading. | |
static std::string | stagePath () |
Return the STAGEPATH environment variable. | |
Private Member Functions | |
std::string | stripFilename (const std::string &path) |
Private Attributes | |
std::string | WorldsRoot |
Definition at line 9 of file file_manager.hh.
Definition at line 25 of file file_manager.cc.
std::string Stg::FileManager::findFile | ( | const std::string & | filename | ) | [static] |
Search for a file in the current directory, in the prefix/share/stage location, and in the locations specified by the STAGEPATH environment variable. Returns the first match or the original filename if not found.
Definition at line 36 of file file_manager.cc.
void Stg::FileManager::newWorld | ( | const std::string & | worldfile | ) | [inline] |
Update the worldfile path.
Definition at line 20 of file file_manager.hh.
bool Stg::FileManager::readable | ( | const std::string & | path | ) | [static] |
Determine whether a file can be opened for reading.
Definition at line 68 of file file_manager.cc.
std::string Stg::FileManager::stagePath | ( | ) | [static] |
Return the STAGEPATH environment variable.
Definition at line 28 of file file_manager.cc.
std::string Stg::FileManager::stripFilename | ( | const std::string & | path | ) | [private] |
Definition at line 80 of file file_manager.cc.
const std::string Stg::FileManager::worldsRoot | ( | ) | const [inline] |
Return the path where the current worldfile was loaded from.
Definition at line 18 of file file_manager.hh.
std::string Stg::FileManager::WorldsRoot [private] |
Definition at line 11 of file file_manager.hh.