X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdir.h;h=30ef33dbeed4120747759f23cc71882e47bf5459;hb=3160a8b4cb443d282f7ca1e9d7c5ca53be173cc4;hp=25ec776b2b814f4616e32f9a83d59ebe18d3bb6e;hpb=f91f1df3e0b00b3a270e571d4b2c8251da4d1226;p=libs%2Fcore.git diff --git a/source/dir.h b/source/dir.h index 25ec776..30ef33d 100644 --- a/source/dir.h +++ b/source/dir.h @@ -10,33 +10,44 @@ Distributed under the LGPL #include #include +#include "path.h" namespace Msp { namespace FS { -class Path; - /// Creates a directory void mkdir(const Path &path, int mode); /// Creates a directory and any required parent directories void mkpath(const Path &path, int mode); -/// Removes a directory +/// Removes a directory, which must be empty void rmdir(const Path &path); /// Removes a directory and anything it contains -void rmdirs(const Path &path); +void rmpath(const Path &path); /// Lists the contents of a directory std::list list_files(const Path &path); +/// Lists the contents of a directory, filtered with a regex +std::list list_filtered(const Path &path, const std::string &filter); + /// Returns the current working directory Path getcwd(); /// Returns the user's home directory Path get_home_dir(); +/// Returns a directory suitable for storing user-specific data +Path get_user_data_dir(const std::string &appname); + +/// Returns a directory containing system-wide configuration +Path get_sys_conf_dir(const Path &argv0); + +/// Returns a directory containing immutable system-wide data +Path get_sys_data_dir(const Path &argv0, const std::string &appname); + /// Changes the current working directory void chdir(const Path &);