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,2022 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 
58  FXbool open(const FXString& path);
59 
61  FXbool isOpen() const;
62 
64  FXbool next(FXString& name);
65 
67  void close();
68 
69 
71  static FXbool create(const FXString& path,FXuint perm=FXIO::AllFull);
72 
74  static FXbool remove(const FXString& path);
75 
76 
82  static FXint listFiles(FXString*& filelist,const FXString& path,const FXString& pattern="*",FXuint flags=FXDir::MatchAll);
83 
92  static FXint listDrives(FXString*& drivelist);
93 
94 
96  static FXbool createDirectories(const FXString& path,FXuint perm=FXIO::AllFull);
97 
98 
100  ~FXDir();
101  };
102 
103 
104 }
105 
106 #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