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,2017 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 private:
32  FXDir(const FXDir&);
33  FXDir &operator=(const FXDir&);
34 public:
35 
37  enum {
38  MatchAll = 0,
39  NoFiles = 1,
40  NoDirs = 2,
41  AllFiles = 4,
42  AllDirs = 8,
43  HiddenFiles = 16,
44  HiddenDirs = 32,
45  NoParent = 64,
46  CaseFold = 128
47  };
48 
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 
88  static FXint listDrives(FXString*& drivelist);
89 
90 
92  static FXbool createDirectories(const FXString& path,FXuint perm=FXIO::AllFull);
93 
94 
96  ~FXDir();
97  };
98 
99 
100 }
101 
102 #endif

Copyright © 1997-2016 Jeroen van der Zijp