uLib
User mode C/C++ extended API library for Win32 programmers.
|
#include <uLib/FileDir.h>
ScanDirCtx is used by DirEntry to control recursion depth et c.
It also contains the per-context current directory, and additional data.
Unless you're an expert programmer, you should threat the struct as R/O.
If you call DirEntry::ScanDir() or Scan() concurrently on different threads,
you must provide a ScanDirCtx for each thread, or strangeness will arise.
If you don't provide a scan context, ScanDir() uses one internal static.
Note: You don't need to initialize ScanDirCtx for the typical case,
since essential defaults are filled in by the c'tor and ScanDir().
You can use UserData to pass data to the FileEntry / DirEntry callbacks.
You can also declare a descendant to pass more data, and up-cast the pCtx
pointer to your own struct in the callbacks where you need it.
Public Data | |
UINT | NestDepth |
UINT | MaxNest |
WORD | Flags |
WORD | _rsv |
TCHAR | CurrentDir [MAX_PATH] |
TSTR | PathEnd |
PVOID | UserData |
PDLinkList | ErrorDirs |
Public Functions | |
ScanDirCtx (UINT Depth=0) | |
~ScanDirCtx () | |
ScanDirCtx::ScanDirCtx | ( | UINT | Depth = 0 | ) |
0 == Use default (i.e. max recursion depth).
Definition at line 19 of file FileDir.cpp.
ScanDirCtx::~ScanDirCtx | ( | ) |
Definition at line 30 of file FileDir.cpp.
TCHAR ScanDirCtx::CurrentDir[MAX_PATH] |
TSTR ScanDirCtx::PathEnd |
PDLinkList ScanDirCtx::ErrorDirs |
[PRELIMINARY] List of StringEntry with directories where DirEntry::Scan failed.
StringEntry::Name contains the full path, and StringEntry::Data the error code.
Note: ErrorDirs will be NULL if no scan errors occurred.