2 % automatically generated by HelpGen from
3 % include\wx\dir.h at 11/Dec/99 00:55:30
7 \section{\class{wxDir
}}\label{wxdir
}
9 wxDir is a portable equivalent of Unix
{open/read/close
}dir functions which
10 allow enumerating of the files in a directory. wxDir allows enumerate files as
16 wxDir dir(wxGetCwd());
18 if ( !dir.IsOpened() )
20 // deal with the error here - wxDir would already log an error message
21 // explaining the exact reason of the failure
25 puts("Enumerating object files in current directory:");
29 bool cont = dir.GetFirst(&filename, filespec, flags);
32 printf("
%s\n", filename.c_str());
34 cont = dir.GetNext(&filename);
38 \wxheading{Derived from
}
44 These flags define what kind of filenames is included in the list of files
45 enumerated by GetFirst/GetNext
51 wxDIR_FILES =
0x0001, // include files
52 wxDIR_DIRS =
0x0002, // include directories
53 wxDIR_HIDDEN =
0x0004, // include hidden files
54 wxDIR_DOTDOT =
0x0008, // include '.' and '..'
56 // by default, enumerate everything except '.' and '..'
57 wxDIR_DEFAULT = wxDIR_FILES | wxDIR_DIRS | wxDIR_HIDDEN
62 \wxheading{Include files
}
66 \latexignore{\rtfignore{\wxheading{Members
}}}
68 \membersection{wxDir::Exists
}\label{wxdirexists
}
70 \func{static bool
}{Exists
}{\param{const wxString\&
}{dir
}}
72 Test for existence of a directory with the given name
74 \membersection{wxDir::wxDir
}\label{wxdirwxdir
}
78 Default constructor, use
\helpref{Open()
}{wxdiropen
} afterwards.
80 \func{}{wxDir
}{\param{const wxString\&
}{dir
}}
82 Opens the directory for enumeration, use
\helpref{IsOpened()
}{wxdirisopened
}
85 \membersection{wxDir::
\destruct{wxDir
}}\label{wxdirdtor
}
87 \func{}{\destruct{wxDir
}}{\void}
89 Destructor cleans up the associated ressources. It is not virtual and so this
90 class is not meant to be used polymorphically.
92 \membersection{wxDir::Open
}\label{wxdiropen
}
94 \func{bool
}{Open
}{\param{const wxString\&
}{dir
}}
96 Open the directory for enumerating, returns TRUE on success or FALSE if an
99 \membersection{wxDir::IsOpened
}\label{wxdirisopened
}
101 \constfunc{bool
}{IsOpened
}{\void}
103 Returns TRUE if the directory was successfully opened by a previous call to
104 \helpref{Open
}{wxdiropen
}.
106 \membersection{wxDir::GetFirst
}\label{wxdirgetfirst
}
108 \constfunc{bool
}{GetFirst
}{\param{wxString*
}{filename
},
\param{const wxString\&
}{filespec = wxEmptyString
},
\param{int
}{flags = wxDIR
\_DEFAULT}}
110 Start enumerating all files matching
{\it filespec
} (or all files if it is
111 empty) and flags, return TRUE on success.
113 \membersection{wxDir::GetNext
}\label{wxdirgetnext
}
115 \constfunc{bool
}{GetNext
}{\param{wxString*
}{filename
}}
117 Continue enumerating files satisfying the criteria specified by the last call
118 to
\helpref{GetFirst
}{wxdirgetfirst
}.