Stg::FileManager Class Reference

#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 std::string homeDirectory ()
 Returns the path to the current user's home directory (or empty if not detectable):
 
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.
 

Constructor & Destructor Documentation

◆ FileManager()

Stg::FileManager::FileManager ( )

Member Function Documentation

◆ findFile()

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.

◆ homeDirectory()

std::string Stg::FileManager::homeDirectory ( )
static

Returns the path to the current user's home directory (or empty if not detectable):

◆ newWorld()

void Stg::FileManager::newWorld ( const std::string &  worldfile)

Update the worldfile path.

◆ readable()

bool Stg::FileManager::readable ( const std::string &  path)
static

Determine whether a file can be opened for reading.

◆ stagePath()

std::string Stg::FileManager::stagePath ( )
static

Return the STAGEPATH environment variable.

◆ worldsRoot()

const std::string Stg::FileManager::worldsRoot ( ) const
inline

Return the path where the current worldfile was loaded from.


The documentation for this class was generated from the following files: