FileWatcher(3)

πŸ“¦ version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

✨ FileWatcher(3) β€” File Watcher Library ✨

okay bestie, welcome to the File Watcher Library manual, section 3 🫢 this is literally the page for the FileWatcher class and it's giving main character energy fr fr.


🌸 NAME 🌸

FileWatcher β€” the File watcher class, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libkyfilewatcher.hpp>

πŸ’– DESCRIPTION πŸ’–

okay so the FileWatcher class is mainly here to do all of this:

  • 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
  • resume file monitoring

and like, the whole class lives inside the KYSDK_FILEWATCHER namespace. that's its home. that's its vibe. 🏠✨


πŸ‘‘ MEMBER FUNCTIONS πŸ‘‘

QStringList addWatchTargetRecursive (QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)

Add a file path that needs to be monitored. and bestie, for directories, recursive monitoring of subdirectories is enabled by default β€” it just does the thing automatically πŸŽ€

Parameters:

  • url β€” File path
  • type β€” File monitoring type
  • attr β€” File monitoring attributes
  • maxdepth β€” Specify the maximum depth for traversal search
  • recurType β€” Recursive type

Return value:

  • QStringList β€” List of successfully added monitoring target paths

QStringList addWatchTargetListRecursive (QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)

Add a list of files that need to be monitored. same energy, but bulk edition πŸ“

Parameters:

  • urlList β€” List of files to be monitored
  • type β€” File monitoring type
  • attr β€” File monitoring attributes
  • maxdepth β€” Specify the maximum depth for traversal search
  • recurType β€” Recursive type

Return value:

  • QStringList β€” List of successfully added monitoring target paths

QStringList removeWatchTargetRecursive (QString url, int maxdepth = 5, int recurType = ALLFILE)

Remove the specified file from the monitoring list. bye boo πŸ‘‹ not me removing you from the watch list, it's giving unfollowed.

Parameters:

  • url β€” Path of the specified file
  • maxdepth β€” Specify the maximum depth for traversal search
  • recurType β€” Recursive type

Return value:

  • QStringList β€” List of successfully removed monitoring target paths

void clearWatchList ()

Clear the monitoring list. total reset, clean slate, fresh start ✨🧼


void pauseWatcher ()

Pause file monitoring. it's on a lil break, don't perceive it πŸ’€


void restartWatcher ()

Resume file monitoring. and we're BACK, periodt πŸ”₯


🌈 ENUMERATIONS 🌈

FileWatcherType

  • ONESHOT = 0
  • PERIODIC
  • NEVER

FileWatcherAttribute

  • 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

RecursiveType

  • DIR = 1 << 0
  • REGULAR = 1 << 1
  • HIDDEN = 1 << 2
  • TMPFILE = 1 << 3
  • ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR

🧚 CONFORMING TO 🧚

These functions conform to the withdrawn POSIX.1e draft specification. and okay, here's the tea β€” the following functions are Linux extensions:

  • addWatchTargetRecursive()
  • addWatchTargetListRecursive()
  • removeWatchTargetRecursive()
  • clearWatchList()
  • pauseWatcher()
  • restartWatcher()

πŸ”­ SEE ALSO πŸ”­

inotify(7), libkyfilewatcher(3)


πŸŽ€ AUTHOR πŸŽ€

Generated automatically by Doxygen for libkyfilewatcher.hpp from the source code. (yes, a robot wrote it, and honestly? it ate πŸ’…)


and that's the whole page bestie, you're officially a FileWatcher scholar now, iykyk πŸ¦‹

signed off with version 1.0 and dated Wed Sep 20 2023 β€” mwah, drink water, bye πŸ’–

πŸ“¦ where this page comes from