Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXDir.h
1 /********************************************************************************
2 * *
3 * D i r e c t o r y E n u m e r a t o r *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2005,2025 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXDIR_H
22 #define FXDIR_H
23 
24 namespace FX {
25 
26 
28 class FXAPI FXDir {
29 private:
30  FXuval space[256];
31 public:
32 
34  enum {
35  MatchAll = 0,
36  NoFiles = 1,
37  NoDirs = 2,
38  AllFiles = 4,
39  AllDirs = 8,
40  HiddenFiles = 16,
41  HiddenDirs = 32,
42  NoParent = 64,
43  CaseFold = 128
44  };
45 
46 private:
47  FXDir(const FXDir&);
48  FXDir &operator=(const FXDir&);
49 public:
50 
52  FXDir();
53 
55  FXDir(const FXString& path);
56 
60  FXbool open(const FXString& path);
61 
65  FXbool isOpen() const;
66 
70  FXbool next(FXString& name);
71 
78  FXbool next(FXString& name,FXuint& mode);
79 
83  void close();
84 
85 
87  static FXbool create(const FXString& path,FXuint perm=FXIO::AllFull);
88 
90  static FXbool remove(const FXString& path);
91 
92 
98  static FXint listFiles(FXString*& filelist,const FXString& path,const FXString& pattern="*",FXuint flags=FXDir::MatchAll);
99 
108  static FXint listDrives(FXString*& drivelist);
109 
115  static FXint listShares(FXString*& sharelist);
116 
118  static FXbool createDirectories(const FXString& path,FXuint perm=FXIO::AllFull);
119 
121  static FXbool hasSubDirectories(const FXString& path);
122 
124  ~FXDir();
125  };
126 
127 
128 }
129 
130 #endif
Definition: FX4Splitter.h:28
Read and write permission for all.
Definition: FXIO.h:93
Directory enumerator.
Definition: FXDir.h:28
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp