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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXDir.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                    D i r e c t o r y   E n u m e r a t o r                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2005,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXDIR_H
00022 #define FXDIR_H
00023 
00024 namespace FX {
00025 
00026 
00028 class FXAPI FXDir {
00029 private:
00030   FXuval space[256];
00031 private:
00032   FXDir(const FXDir&);
00033   FXDir &operator=(const FXDir&);
00034 public:
00035 
00037   enum {
00038     MatchAll    = 0,              
00039     NoFiles     = 1,              
00040     NoDirs      = 2,              
00041     AllFiles    = 4,              
00042     AllDirs     = 8,              
00043     HiddenFiles = 16,             
00044     HiddenDirs  = 32,             
00045     NoParent    = 64,             
00046     CaseFold    = 128             
00047     };
00048 
00049 public:
00050 
00052   FXDir();
00053 
00055   FXDir(const FXString& path);
00056 
00058   virtual FXbool open(const FXString& path);
00059 
00061   virtual FXbool isOpen() const;
00062 
00064   virtual FXbool next(FXString& name);
00065 
00067   virtual void close();
00068 
00069 
00071   static FXbool create(const FXString& path,FXuint perm=FXIO::AllFull);
00072 
00074   static FXbool remove(const FXString& path);
00075 
00077   static FXbool rename(const FXString& srcpath,const FXString& dstpath);
00078 
00079 
00085   static FXint listFiles(FXString*& filelist,const FXString& path,const FXString& pattern="*",FXuint flags=FXDir::MatchAll);
00086 
00091   static FXint listDrives(FXString*& drivelist);
00092 
00093 
00095   static FXbool createDirectories(const FXString& path,FXuint perm=FXIO::AllFull);
00096 
00097 
00099   virtual ~FXDir();
00100   };
00101 
00102 
00103 }
00104 
00105 #endif

Copyright © 1997-2011 Jeroen van der Zijp