X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fdir.h;h=6bd760ced68be0ea6bdd57934d2cce925a32e70d;hp=53228ccd760ce233d235fbef7b13b4b965c5c28b;hb=cc7c798b275b8ea9992eb82d68177ecfd50e0974;hpb=af94bc926e301e9b871dc18662b4fa6e5614fdbf diff --git a/source/fs/dir.h b/source/fs/dir.h index 53228cc..6bd760c 100644 --- a/source/fs/dir.h +++ b/source/fs/dir.h @@ -1,20 +1,21 @@ -/* $Id$ - -This file is part of libmspfs -Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_FS_DIR_H_ #define MSP_FS_DIR_H_ #include +#include #include #include "path.h" namespace Msp { namespace FS { +class not_a_directory: public std::runtime_error +{ +public: + not_a_directory(const Path &); + virtual ~not_a_directory() throw() { } +}; + /// Creates a directory void mkdir(const Path &path, int mode); @@ -42,15 +43,23 @@ Path get_home_dir(); /// Returns a directory suitable for storing user-specific data Path get_user_data_dir(const std::string &appname); +Path get_user_data_dir(); + /// Returns a directory containing system-wide configuration Path get_sys_conf_dir(const std::string &argv0); +Path get_sys_conf_dir(); + /// Returns a directory containing immutable system-wide data Path get_sys_data_dir(const std::string &argv0, const std::string &appname); +Path get_sys_data_dir(); + /// Returns a directory containing system-wide architecture-specific files Path get_sys_lib_dir(const std::string &argv0, const std::string &appname); +Path get_sys_lib_dir(); + /// Changes the current working directory void chdir(const Path &);