uLib  User mode C/C++ extended API library for Win32 programmers.
ScanDirCtx Struct Reference

#include <uLib/FileDir.h>

Detailed Description

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.

Definition at line 222 of file FileDir.h.

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 ()
 

Constructor & Destructor Documentation

◆ ScanDirCtx()

ScanDirCtx::ScanDirCtx ( UINT  Depth = 0)

0 == Use default (i.e. max recursion depth).

Definition at line 19 of file FileDir.cpp.

◆ ~ScanDirCtx()

ScanDirCtx::~ScanDirCtx ( )

Definition at line 30 of file FileDir.cpp.

Member Data Documentation

◆ NestDepth

UINT ScanDirCtx::NestDepth

Definition at line 226 of file FileDir.h.

◆ MaxNest

UINT ScanDirCtx::MaxNest

Scan depth control.

Definition at line 226 of file FileDir.h.

◆ Flags

WORD ScanDirCtx::Flags

Default == SCF_FILES | SCF_DIRS.

Definition at line 227 of file FileDir.h.

◆ _rsv

WORD ScanDirCtx::_rsv

Definition at line 228 of file FileDir.h.

◆ CurrentDir

TCHAR ScanDirCtx::CurrentDir[MAX_PATH]

Per-instance current directory.

Definition at line 229 of file FileDir.h.

◆ PathEnd

TSTR ScanDirCtx::PathEnd

Catenation pointer for CurrentDir.

Definition at line 230 of file FileDir.h.

◆ UserData

PVOID ScanDirCtx::UserData

Arbitrary user data.

Definition at line 234 of file FileDir.h.

◆ ErrorDirs

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.

Definition at line 241 of file FileDir.h.


The documentation for this struct was generated from the following files: