walker.h

来自「傅立叶变换和小波变换是图像压缩的重要工具。该代大戏是利用小波变换进行图像压缩。」· C头文件 代码 · 共 65 行

H
65
字号
#ifndef CRBLIB_WALKER_H
#define CRBLIB_WALKER_H

#include <crblib/fileutil.h>
#include <sys/stat.h>	// for Attr

struct WalkInfo
{
	char * Name;
	char * Path; /* contains ending path delimiter; may be wrong! */
	int NestLevel;
	bool IsDir;
	ulong Size;
	ulong Attr;
	ulong Date;

	char FullName[1024]; /* strcpy(FullName,Path) strcat(FullName,Name) */

	/**********/

	ulong Private;

	/** THIS IS A READ-ONLY STRUCTURE !!! ***/

};

typedef bool (*FileFuncType)(struct WalkInfo * WI);
typedef bool (*DirStartFuncType)(char * FullPath,int NestLevel);
typedef bool (*DirDoneFuncType)(char * FullPath,int NestLevel);
 /* functions return KeepGoing flag */

extern bool WalkDir(char *StartPath,bool RecurseFlag,bool DoDirs,
	FileFuncType FileFunc,DirStartFuncType DirStartFunc,DirDoneFuncType DirDoneFunc);

extern bool WalkDir_DeepFirst(char *StartPath,bool RecurseFlag,bool DoDirs,
	FileFuncType FileFunc,DirStartFuncType DirStartFunc,DirDoneFuncType DirDoneFunc);

extern bool WalkDir_TwoPass(char *StartPath,bool RecurseFlag,bool DoDirs,
	FileFuncType FileFunc,DirStartFuncType DirStartFunc,DirDoneFuncType DirDoneFunc);


/***

normal WalkDir processes directories, then steps into them

_DeepFirst processes all directories, then steps back from the deepest

only relevant when Recurseflag is on
	really only matters when DoDirsFlag is also on

this functionality is needed by Delete

---------

_TwoPass runs FileFunc on all entries in a dir before building
recursing information, then performs another pass to get that info

only relevant when DoDirsFlag && Recurseflag are both on

this functionality is needed by Rename

**/

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?