diff options
Diffstat (limited to 'src/filesystem/filesystem.h')
| -rw-r--r-- | src/filesystem/filesystem.h | 26 | 
1 files changed, 12 insertions, 14 deletions
| diff --git a/src/filesystem/filesystem.h b/src/filesystem/filesystem.h index 83e93c0..f8740d1 100644 --- a/src/filesystem/filesystem.h +++ b/src/filesystem/filesystem.h @@ -11,37 +11,35 @@  #include "filesystem/diskfile.h"  #include <string> +#include <list>  /// The filesystem namespace contains classes and functions for common file operations.  /** filesystem is a core subsystem   */  namespace filesystem { -/// location of the main data files, includes trailing / -extern std::string datadir; +typedef std::list<std::string> SearchPath; -/// location of the personal data files, includes trailing / -extern std::string homedir; - -/// writeable location -extern std::string writedir; - -/// subdirectory with the base data files, includes trailing / -extern std::string basedir; - -/// subdirectory for the current mod, includes trailing / -extern std::string moddir; +SearchPath & searchpath();  /// initialize the filesystem subsystem -void init(); +void init(std::string const & basename, std::string const & modname);  /// shutdown the filesystem subsystem  void shutdown(); +/// current home directory e.g. ~/.osirion/ +std::string const & homedir(); + +/// current write directory e.g. ~/.osirion/base/ +std::string const & writedir(); +  /// open a file and return a pointer to a File instance  File *open(const char *filename); +  /// open a file and return a pointer to a File instance  File *open(const std::string &filename); +  /// close and delete a file instance  void close(File *file); | 
