.TH libkyfilewatcher 3 "Wed Sep 20 2023" "1.0" "File Watcher Library" .SH NAME libkyfilewatcher \- File management functionality .SH SYNOPSIS .B #include .SH DESCRIPTION .PP This library provides file management interfaces and classes. .SH CLASSES .PP .B KYSDK_FILEWATCHER::FileWatcher .RS .PP File management class. Mainly used to add file paths that need to be monitored, add file lists that need to be monitored, remove specified files from the monitoring list, clear the monitoring list, pause file monitoring, and resume file monitoring. .RE .SH ENUMERATIONS .PP .B FileWatcherType .RS .PP .nf ONESHOT = 0 PERIODIC NEVER .fi .RE .PP .B FileWatcherAttribute .RS .PP .nf ACCESS = IN_ACCESS CREATE = IN_CREATE MODIFY = IN_MODIFY DELETE = IN_DELETE | IN_DELETE_SELF ATTRIB = IN_ATTRIB MOVE = IN_MOVE | IN_MOVE_SELF OPEN = IN_OPEN CLOSE = IN_CLOSE ALL = IN_ALL_EVENTS .fi .RE .PP .B RecursiveType .RS .PP .nf DIR = 1 << 0 REGULAR = 1 << 1 HIDDEN = 1 << 2 TMPFILE = 1 << 3 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR .fi .RE .SH "MEMBER FUNCTIONS" .PP .B "QStringList addWatchTargetRecursive (QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a file path that needs to be monitored. For directories, recursive monitoring of subdirectories is enabled by default. .PP .B Parameters: .RS .TP .B url File path .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList addWatchTargetListRecursive (QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a list of files that need to be monitored. .PP .B Parameters: .RS .TP .B urlList List of files to be monitored .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList removeWatchTargetRecursive (QString url, int maxdepth = 5, int recurType = ALLFILE)" .RS .PP Remove the specified file from the monitoring list. .PP .B Parameters: .RS .TP .B url Path of the specified file .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully removed monitoring target paths .RE .RE .PP .B "void clearWatchList ()" .RS .PP Clear the monitoring list. .RE .PP .B "void pauseWatcher ()" .RS .PP Pause file monitoring. .RE .PP .B "void restartWatcher ()" .RS .PP Resume file monitoring. .RE .SH "EXAMPLE USAGE" .PP .nf #include #include #include using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); FileWatcher watcher; // Add directory monitoring QStringList paths = watcher.addWatchTargetRecursive( "/home/user/documents", PERIODIC, MODIFY | DELETE, 3 ); // Pause and resume monitoring watcher.pauseWatcher(); // ... perform some operations watcher.restartWatcher(); return 0; } .fi .SH AUTHOR Generated automatically by Doxygen for libkyfilewatcher.hpp from the source code. .SH "SEE ALSO" .BR inotify (7), .BR QFileSystemWatcher (3qt5), .BR libkyfilewatcher (3)