wxWidgets/docs/latex/wx/dir.tex

120 lines
3.0 KiB
TeX
Raw Normal View History

%
% automatically generated by HelpGen from
% include\wx\dir.h at 11/Dec/99 00:55:30
%
\section{\class{wxDir}}\label{wxdir}
wxDir is a portable equivalent of Unix {open/read/close}dir functions which
allow enumerating of the files in a directory. wxDir allows enumerate files as
well as directories.
Example of use:
\begin{verbatim}
wxDir dir(wxGetCwd());
if ( !dir.IsOpened() )
{
// deal with the error here - wxDir would already log an error message
// explaining the exact reason of the failure
return;
}
puts("Enumerating object files in current directory:");
wxString filename;
bool cont = dir.GetFirst(&filename, filespec, flags);
while ( cont )
{
printf("%s\n", filename.c_str());
cont = dir.GetNext(&filename);
}
\end{verbatim}
\wxheading{Derived from}
No base class
\wxheading{Constants}
These flags define what kind of filenames is included in the list of files
enumerated by GetFirst/GetNext
{\small
\begin{verbatim}
enum
{
wxDIR_FILES = 0x0001, // include files
wxDIR_DIRS = 0x0002, // include directories
wxDIR_HIDDEN = 0x0004, // include hidden files
wxDIR_DOTDOT = 0x0008, // include '.' and '..'
// by default, enumerate everything except '.' and '..'
wxDIR_DEFAULT = wxDIR\_FILES | wxDIR\_DIRS | wxDIR\_HIDDEN
}
\end{verbatim}
}
\wxheading{Include files}
<wx/dir.h>
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDir::Exists}\label{wxdirexists}
\func{static bool}{Exists}{\param{const wxString\& }{dir}}
Test for existence of a directory with the given name
\membersection{wxDir::wxDir}\label{wxdirwxdir}
\func{}{wxDir}{\void}
Default constructor, use \helpref{Open()}{wxdiropen} afterwards.
\func{}{wxDir}{\param{const wxString\& }{dir}}
Opens the directory for enumeration, use \helpref{IsOpened()}{wxdirisopened}
to test for errors.
\membersection{wxDir::\destruct{wxDir}}\label{wxdirdtor}
\func{}{\destruct{wxDir}}{\void}
Destructor cleans up the associated ressources. It is not virtual and so this
class is not meant to be used polymorphically.
\membersection{wxDir::Open}\label{wxdiropen}
\func{bool}{Open}{\param{const wxString\& }{dir}}
Open the directory for enumerating, returns TRUE on success or FALSE if an
error occured.
\membersection{wxDir::IsOpened}\label{wxdirisopened}
\constfunc{bool}{IsOpened}{\void}
Returns TRUE if the directory was successfully opened by a previous call to
\helpref{Open}{wxdiropen}.
\membersection{wxDir::GetFirst}\label{wxdirgetfirst}
\constfunc{bool}{GetFirst}{\param{wxString* }{filename}, \param{const wxString\& }{filespec = wxEmptyString}, \param{int }{flags = wxDIR\_DEFAULT}}
Start enumerating all files matching {\it filespec} (or all files if it is
empty) and flags, return TRUE on success.
\membersection{wxDir::GetNext}\label{wxdirgetnext}
\constfunc{bool}{GetNext}{\param{wxString* }{filename}}
Continue enumerating files satisfying the criteria specified by the last call
to \helpref{GetFirst}{wxdirgetfirst}.