![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Directory enumerator. More...
#include <FXDir.h>
Public Types | |
| enum | { MatchAll = 0, NoFiles = 1, NoDirs = 2, AllFiles = 4, AllDirs = 8, HiddenFiles = 16, HiddenDirs = 32, NoParent = 64, CaseFold = 128 } |
| Options for listing files. More... | |
Public Member Functions | |
| FXDir () | |
| Construct directory enumerator. | |
| FXDir (const FXString &path) | |
| Construct directory enumerator open on path. | |
| FXbool | open (const FXString &path) |
| Open directory to path, return true if ok. | |
| FXbool | isOpen () const |
| Returns true if the directory is open. | |
| FXbool | next (FXString &name) |
| Go to next directory entry and return its name. | |
| FXbool | next (FXString &name, FXuint &mode) |
| Go to next directory entry and return its name and file-mode flags. More... | |
| void | close () |
| Close directory. | |
| ~FXDir () | |
| Destructor. | |
Static Public Member Functions | |
| static FXbool | create (const FXString &path, FXuint perm=FXIO::AllFull) |
| Create directory. | |
| static FXbool | remove (const FXString &path) |
| Remove directory. | |
| static FXint | listFiles (FXString *&filelist, const FXString &path, const FXString &pattern="*", FXuint flags=FXDir::MatchAll) |
| List files in a given directory. More... | |
| static FXint | listDrives (FXString *&drivelist) |
| List drives, i.e. More... | |
| static FXint | listShares (FXString *&sharelist) |
| List connected file shares. More... | |
| static FXbool | createDirectories (const FXString &path, FXuint perm=FXIO::AllFull) |
| Create a directories recursively. | |
| static FXbool | hasSubDirectories (const FXString &path) |
| Check for sub-directories. | |
Directory enumerator.
| anonymous enum |
Options for listing files.
|
static |
List drives, i.e.
the roots of directory trees. On Windows, this returns an array of strings like {"C:\", "D:\", ..., ""}, while on Unix it will be just a two-element list like {"/", ""}. The last element will be always be set to the empty string. The list can be released by means of delete [] list. Returns the number of non-empty elements in the array.
|
static |
List files in a given directory.
Returns the number of files in the string-array list which matched the pattern or satisfied the flag conditions.
|
static |
List connected file shares.
On Linux, this just returns "/". On Windows, this returns a list of connected network drives.
| FXbool FX::FXDir::next | ( | FXString & | name, |
| FXuint & | mode | ||
| ) |
Go to next directory entry and return its name and file-mode flags.
If mode flag is zero, FXStat::statFile() will be needed to obtain file type and permissions. Otherwise, mode flag will indicate file type and permissions on Windows, but only file type on Linux.
|
|