]> git.tdb.fi Git - libs/core.git/blob - source/fs/dir.h
Remove Id tags and copyright notices from source files
[libs/core.git] / source / fs / dir.h
1 #ifndef MSP_FS_DIR_H_
2 #define MSP_FS_DIR_H_
3
4 #include <list>
5 #include <string>
6 #include "path.h"
7
8 namespace Msp {
9 namespace FS {
10
11 /// Creates a directory
12 void mkdir(const Path &path, int mode);
13
14 /// Creates a directory and any required parent directories
15 void mkpath(const Path &path, int mode);
16
17 /// Removes a directory, which must be empty
18 void rmdir(const Path &path);
19
20 /// Removes a directory and anything it contains
21 void rmpath(const Path &path);
22
23 /// Lists the contents of a directory
24 std::list<std::string> list_files(const Path &path);
25
26 /// Lists the contents of a directory, filtered with a regex
27 std::list<std::string> list_filtered(const Path &path, const std::string &filter);
28
29 /// Returns the current working directory
30 Path getcwd();
31
32 /// Returns the user's home directory
33 Path get_home_dir();
34
35 /// Returns a directory suitable for storing user-specific data
36 Path get_user_data_dir(const std::string &appname);
37
38 /// Returns a directory containing system-wide configuration
39 Path get_sys_conf_dir(const std::string &argv0);
40
41 /// Returns a directory containing immutable system-wide data
42 Path get_sys_data_dir(const std::string &argv0, const std::string &appname);
43
44 /// Returns a directory containing system-wide architecture-specific files
45 Path get_sys_lib_dir(const std::string &argv0, const std::string &appname);
46
47 /// Changes the current working directory
48 void chdir(const Path &);
49
50 } // namespace FS
51 } // namespace Msp
52
53 #endif