⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directorywatcher.h

📁 监测指定目录的变化
💻 H
字号:
/*
	2007-11-16:	charlie
		TCONSOLE	output the message to console;
		NEXT:
			1 TLOGLEVEL	write text log file of changesw

	USEAGE:
		see DirectoryWater.cpp
*/
//my debug mode
#define	TDEBUG
//cout & cin for test mode
#define	TCONSOLE
//for my log level, 9 is everything, 0 is nothing
#define	TLOGLEVEL	1


#ifndef _DIRWATCHER
	#define	_DIRWATCHER
#endif



#define _WIN32_WINNT 0x0500

#include <windows.h>
#include <iostream>

using namespace std;


class	CDirectoryWatcher
{
private:
	string strWatchedDir;
    HANDLE hThread;
    HANDLE hDir;	

    static DWORD WINAPI ThreadProc( LPVOID lParam );
	
public:
	bool	Start(string path);
	inline	bool	Start();
	inline	void	Stop();
	inline	bool	Status();
	inline	void	Set(string path);
	string Get();
/*
	bool	Log();
	bool	LogStart();
	bool	LogStart(int level);
	bool	Logstop();
*/

	
	CDirectoryWatcher();
	~CDirectoryWatcher();
};

⌨️ 快捷键说明

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