8 #ifndef __FileDir_h_incl__ 9 #define __FileDir_h_incl__ 38 #ifdef __cplusplus // The rest of this module is C++ 90 #if !defined(__DOXYGEN__) 95 #else // doxygen can't seem to parse the plain function pointers, so subst with mock-ups... 113 #ifndef USE_FILE_ENTRY_SIZEATTR 114 #define USE_FILE_ENTRY_SIZEATTR 1 // Define as 0 if not needed (to save RAM). 116 #define FILEDIR_NEWALLOC 0 // Use custom new/delete for File/DirEntry 125 #pragma pack( push, 4 ) 130 #if USE_FILE_ENTRY_SIZEATTR // Optional std data (20B)... 190 static bool __stdcall _dump( PLIST_ENTRY Entry, void* pData ); 194 void*
operator new(
size_t nBytes ) {
return mem_Alloc( nBytes ); }
195 void operator delete(
void* pBlk ) {
mem_Free( pBlk ); }
221 #pragma pack( push, 2 ) 253 #define SCF_FILES 0x0001 254 #define SCF_DIRS 0x0002 255 #ifndef __DOXYGEN__ // NYI (postponed, complicated ramifications) 256 #define SCF_SPLIT 0x0004 // TODO: [uLib:FileDir.h] Split composite basedir entries. 259 #define MAX_DIRECTORY_DEPTH 256 267 #pragma pack( push, 4 ) 272 #if USE_FILE_ENTRY_SIZEATTR 394 static bool __stdcall _dump( PLIST_ENTRY Entry, void* pData ); 398 void*
operator new(
size_t nBytes ) {
return mem_Alloc( nBytes ); }
399 void operator delete(
void* pBlk ) {
mem_Free( pBlk ); }
410 #endif//def __cplusplus 411 #endif//ndef __FileDir_h_incl__
PDirEntry __stdcall __new_DirEntry(LPWIN32_FIND_DATA pfd, PDirEntry pDir, PScanDirCtx pCtx)
bool(__stdcall * PFnDirAddAction)(PDirEntry pDir, LPWIN32_FIND_DATA pFD, PScanDirCtx pCtx)
TCHAR CurrentDir[MAX_PATH]
UINT Scan(PScanDirCtx pCtx)
UINT GetFullPath(TSTR Buff, UINT BufLen)
void * mem_Alloc(size_t Bytes)
CSTR Rename(CSTR newName)
DirEntry(LPWIN32_FIND_DATA pFd, PDirEntry pParent=NULL, PScanDirCtx pCtx=NULL)
struct _LIST_ENTRY * PLIST_ENTRY
bool(__stdcall * PFnFileAddAction)(PFileEntry pFile, LPWIN32_FIND_DATA pFD, PScanDirCtx pCtx)
static PFnFileAction DelAction
static bool __stdcall _delete(PLIST_ENTRY Entry, void *pData)
PDirEntry AddSubDir(CSTR pzDir, PScanDirCtx pCtx)
bool(__stdcall * PFnDirAction)(PDirEntry pDir, PScanDirCtx pCtx)
static PDirEntry ScanDir(CSTR BaseDir, UINT Depth=0, PDirEntry Parent=NULL, PUINT pCount=NULL, PScanDirCtx pCtx=NULL)
bool(__stdcall * PFnAbortScan)(PDirEntry pDir, PScanDirCtx pCtx)
void * mem_Free(void *pBlk)
static bool __stdcall _delete(PLIST_ENTRY Entry, void *pData)
PFileEntry __stdcall NewFileEntry(LPWIN32_FIND_DATA pfd, PDirEntry pDir, PScanDirCtx pCtx)
bool(__stdcall * PFnFileAction)(PFileEntry pFile, PScanDirCtx pCtx)
static PFnAbortScan Abort
class DLinkList * PDLinkList
CSTR LongestCommonPath(CSTR PathName1, CSTR PathName2)
PDirEntry PScanDirCtx pCtx
FileEntry(LPWIN32_FIND_DATA pFd, PDirEntry Dir, PScanDirCtx pCtx=NULL)
Common include; Added types, small "ubiquitous" utilities, et c.
UINT GetPathName(TSTR Buffer, UINT BufLen)
PDirEntry __stdcall NewDirEntry(LPWIN32_FIND_DATA pfd, PDirEntry pDir, PScanDirCtx pCtx)
PFileEntry AddFile(LPWIN32_FIND_DATA pFd, PScanDirCtx pCtx)
static PFnDirAction DelAction
bool GetFindData(LPWIN32_FIND_DATA pData)
PFileEntry __stdcall __new_FileEntry(LPWIN32_FIND_DATA pfd, PDirEntry pDir, PScanDirCtx pCtx)
static PFnFileAddAction AddAction
static PFnDirAddAction AddAction