]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/dir.h
Zero-arguments overloads and better error checking for get*dir functions
[libs/core.git] / source / fs / dir.h
index 5544a3179b912e9d7f14a4687095aaeabd7a547d..6bd760ced68be0ea6bdd57934d2cce925a32e70d 100644 (file)
@@ -2,12 +2,20 @@
 #define MSP_FS_DIR_H_
 
 #include <list>
+#include <stdexcept>
 #include <string>
 #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);
 
@@ -35,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 &);