Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FileSystemWatcher::Listener Class Reference

Listener interface for receiving file system change notifications. More...

#include <gin_filesystemwatcher.h>

Public Member Functions

virtual ~Listener ()=default
 
virtual void folderChanged (const juce::File &)
 Called when any file in a watched folder changes.
 
virtual void fileChanged (const juce::File &, FileSystemEvent)
 Called for each file that changed and how it changed.
 

Detailed Description

Listener interface for receiving file system change notifications.

Listener provides two callback methods for responding to file system events:

Override the methods you need and add the listener to FileSystemWatcher to receive notifications on the message thread.

Usage Example:

{
void folderChanged(const File& folder) override
{
// Refresh UI for any changes in this folder
DBG("Folder changed: " + folder.getFullPathName());
}
void fileChanged(const File& file, FileSystemEvent event) override
{
// Handle specific file changes
if (event == fileUpdated)
reloadFile(file);
else if (event == fileDeleted)
}
};
Listener interface for receiving file system change notifications.
Definition gin_filesystemwatcher.h:167
FileSystemEvent
File system event types for change notifications.
Definition gin_filesystemwatcher.h:123
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
See also
FileSystemWatcher, FileSystemEvent

Constructor & Destructor Documentation

◆ ~Listener()

virtual FileSystemWatcher::Listener::~Listener ( )
virtualdefault

Member Function Documentation

◆ folderChanged()

virtual void FileSystemWatcher::Listener::folderChanged ( const juce::File &  )
virtual

Called when any file in a watched folder changes.

This is called once per folder when any change occurs, useful for refreshing file browsers or folder displays without needing to know which specific files changed.

Parameters
folderThe watched folder that contains changed files

◆ fileChanged()

virtual void FileSystemWatcher::Listener::fileChanged ( const juce::File &  ,
FileSystemEvent   
)
virtual

Called for each file that changed and how it changed.

This provides detailed information about each file change, including the specific event type. Use this when you need to react to specific changes like file updates for auto-reloading.

Parameters
fileThe specific file that changed
eventThe type of change that occurred

The documentation for this class was generated from the following file: