11 class not_a_directory: public std::runtime_error
14 not_a_directory(const Path &);
15 virtual ~not_a_directory() throw() { }
18 /// Creates a directory
19 void mkdir(const Path &path, int mode);
21 /// Creates a directory and any required parent directories
22 void mkpath(const Path &path, int mode);
24 /// Removes a directory, which must be empty
25 void rmdir(const Path &path);
27 /// Removes a directory and anything it contains
28 void rmpath(const Path &path);
30 /// Lists the contents of a directory
31 std::list<std::string> list_files(const Path &path);
33 /// Lists the contents of a directory, filtered with a regex
34 std::list<std::string> list_filtered(const Path &path, const std::string &filter);
36 /// Returns the current working directory
39 /// Returns the user's home directory
42 /// Returns a directory suitable for storing user-specific data
43 Path get_user_data_dir(const std::string &appname);
45 /// Returns a directory containing system-wide configuration
46 Path get_sys_conf_dir(const std::string &argv0);
48 /// Returns a directory containing immutable system-wide data
49 Path get_sys_data_dir(const std::string &argv0, const std::string &appname);
51 /// Returns a directory containing system-wide architecture-specific files
52 Path get_sys_lib_dir(const std::string &argv0, const std::string &appname);
54 /// Changes the current working directory
55 void chdir(const Path &);