edelib  2.1.0
Directory.h
1 /*
2  * $Id: Directory.h 2844 2009-09-29 10:10:26Z karijes $
3  *
4  * Directory handlers
5  * Copyright (c) 2005-2007 edelib authors
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __EDELIB_DIRECTORY_H__
22 #define __EDELIB_DIRECTORY_H__
23 
24 #include "String.h"
25 #include "List.h"
26 
33 #define E_DIR_SEPARATOR '/'
34 
41 #define E_DIR_SEPARATOR_STR "/"
42 
43 EDELIB_NS_BEGIN
44 
49 EDELIB_API bool dir_exists(const char* name) EDELIB_DEPRECATED;
50 
55 EDELIB_API bool dir_readable(const char* name) EDELIB_DEPRECATED;
56 
61 EDELIB_API bool dir_writeable(const char* name) EDELIB_DEPRECATED;
62 
70 EDELIB_API bool dir_create(const char* name, int perm = 0777);
71 
78 EDELIB_API bool dir_create_with_parents(const char* name, int perm = 0777);
79 
85 EDELIB_API bool dir_remove(const char* name);
86 
91 EDELIB_API bool dir_rename(const char* from, const char* to);
92 
106 EDELIB_API bool dir_empty(const char* name);
107 
111 EDELIB_API String dir_home(void);
112 
116 EDELIB_API String dir_current(void);
117 
135 EDELIB_API bool dir_list(const char* dir, list<String>& lst, bool full_path = false, bool show_hidden = false,
136  bool show_dots = false);
137 
138 EDELIB_NS_END
139 #endif
140