FXDir.h

Go to the documentation of this file.
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,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXDir.h,v 1.24 2006/01/22 17:58:00 fox Exp $                             *
00023 ********************************************************************************/
00024 #ifndef FXDIR_H
00025 #define FXDIR_H
00026 
00027 #include "FXIO.h"
00028 
00029 namespace FX {
00030 
00031 
00032 
00034 class FXAPI FXDir {
00035 private:
00036   FXuval space[256];
00037 private:
00038   FXDir(const FXDir&);
00039   FXDir &operator=(const FXDir&);
00040 public:
00041 
00043   enum {
00044     MatchAll    = 0,              
00045     NoFiles     = 1,              
00046     NoDirs      = 2,              
00047     AllFiles    = 4,              
00048     AllDirs     = 8,              
00049     HiddenFiles = 16,             
00050     HiddenDirs  = 32,             
00051     NoParent    = 64,             
00052     CaseFold    = 128             
00053     };
00054 
00055 public:
00056 
00058   FXDEPRECATEDEXT FXDir();
00059 
00061   FXDEPRECATEDEXT FXDir(const FXString& path);
00062 
00064   virtual bool open(const FXString& path);
00065 
00067   virtual bool isOpen() const;
00068 
00070   virtual bool next();
00071 
00073   virtual FXString name() const;
00074 
00076   virtual void close();
00077 
00079   static bool create(const FXString& path,FXuint mode=FXIO::OwnerFull|FXIO::GroupFull|FXIO::OtherFull);
00080 
00082   static bool remove(const FXString& path);
00083 
00085   static bool rename(const FXString& srcpath,const FXString& dstpath);
00086 
00092   static FXint listFiles(FXString*& filelist,const FXString& path,const FXString& pattern="*",FXuint flags=FXDir::MatchAll);
00093 
00098   static FXint listDrives(FXString*& drivelist);
00099 
00100 
00102   virtual ~FXDir();
00103   };
00104 
00105 }
00106 
00107 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:20 2009 for TnFOX by doxygen v1.4.7