Improve wxDir::Traverse() documentation.

It didn't describe wxDIR_FILES correctly and didn't mention OnOpenError().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-17 16:10:22 +00:00
parent 3ecb4c01f2
commit 3d65f6463b

View File

@@ -310,24 +310,28 @@ public:
static bool Remove(const wxString &dir, int flags = 0); static bool Remove(const wxString &dir, int flags = 0);
/** /**
Enumerate all files and directories under the given directory Enumerate all files and directories under the given directory.
recursively calling the element of the provided wxDirTraverser object
for each of them.
More precisely, the function will really recurse into subdirectories if If @a flags contains ::wxDIR_DIRS this enumeration is recursive, i.e.
@a flags contains ::wxDIR_DIRS flag. It will ignore the files (but all the subdirectories of the given one and the files inside them will
still possibly recurse into subdirectories) if ::wxDIR_FILES flag is be traversed. Otherwise only the files in this directory itself are.
given.
See ::wxDirFlags for the list of the possible flags. If @a flags doesn't contain ::wxDIR_FILES then only subdirectories are
examined but not normal files. It doesn't make sense to not specify
either ::wxDIR_DIRS or ::wxDIR_FILES and usually both of them should be
specified, as is the case by default.
For each directory found, @ref wxDirTraverser::OnDir() "sink.OnDir()" For each directory found, @ref wxDirTraverser::OnDir() "sink.OnDir()"
is called and @ref wxDirTraverser::OnFile() "sink.OnFile()" is called is called and @ref wxDirTraverser::OnFile() "sink.OnFile()" is called
for every file. Depending on the return value, the enumeration may for every file. Depending on the return value, the enumeration may
continue or stop. continue or stop. If entering a subdirectory fails, @ref
wxDirTraverser::OnOpenError() "sink.OnOpenError()" is called.
The function returns the total number of files found or @c "(size_t)-1" The function returns the total number of files found or @c "(size_t)-1"
on error. on error.
See ::wxDirFlags for the full list of the possible flags.
@see GetAllFiles() @see GetAllFiles()
*/ */
size_t Traverse(wxDirTraverser& sink, size_t Traverse(wxDirTraverser& sink,