X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fdir.h;h=c0a1c7460324f3163715d5c119b0fea701b3517e;hp=d62df8cde781896d30fc64a1f99091fa22c3fcef;hb=44da9fc9afb6b7e49c1558c5572213a1e6f401e8;hpb=60260b5701bab73f8de093147de03947c7f264c8 diff --git a/source/fs/dir.h b/source/fs/dir.h index d62df8c..c0a1c74 100644 --- a/source/fs/dir.h +++ b/source/fs/dir.h @@ -1,9 +1,9 @@ #ifndef MSP_FS_DIR_H_ #define MSP_FS_DIR_H_ -#include #include #include +#include #include "path.h" namespace Msp { @@ -29,43 +29,35 @@ void rmdir(const Path &path); void rmpath(const Path &path); /// Lists the contents of a directory -std::list list_files(const Path &path); +std::vector 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); +std::vector list_filtered(const Path &path, const std::string &filter); /// Returns the current working directory Path getcwd(); +/// Changes the current working directory +void chdir(const Path &); + /// 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 suitable for storing user-specific data. Path get_user_data_dir(); -/// Returns a directory containing system-wide configuration -Path get_sys_conf_dir(const std::string &argv0); - +/// Returns a directory containing system-wide configuration. 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); - +/// Returns a directory containing immutable system-wide data. 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); - +/// Returns a directory containing system-wide architecture-specific files. Path get_sys_lib_dir(); -/// Changes the current working directory -void chdir(const Path &); - /** Looks for a file in a list of paths. Returns the absolute path to the first existing location, or an empty Path if the file is not found at all. */ -Path path_lookup(const std::string &, const std::list &); +Path path_lookup(const std::string &, const std::vector &); /** Looks for a file using the PATH environment variable. */ Path path_lookup(const std::string &);