如何计算FSEventStreamEventFlags?

时间:2016-04-17 22:27:52

标签: c++ objective-c macos objective-c++ fsevents

在OSX上,我使用this technique检测在文件夹路径(或子路径)中拖放,删除和创建的新文件。

但是,Apple Documentation并未包含有关如何计算FSEventStreamEventFlags值的任何信息。

因此,通过反复试验,我必须像这样制作一个数组:

const unsigned short TOTAL_EVENTS = 9;
unsigned int anEvents[TOTAL_EVENTS];
anEvents[0] = 125184; // download
anEvents[1] = 105728; // another way to download
anEvents[2] = 116992; // another way to download
anEvents[3] = 128256; // same folder paste
anEvents[4] = 108544; // new file created
anEvents[5] = 110848; // another way new file created
anEvents[6] = 67584; // file dragged in
anEvents[7] = 127232; // file inside folder that was dragged in
anEvents[8] = 128768; // file replace on paste

请告诉我必须有更好的方法吗?我的意思是,肯定这些数字是一些基数上的一些按位AND的结果,然后我可以更科学地做这个而不是存储一些常数?

0 个答案:

没有答案