Gin
Classes | Public Types | Public Member Functions | List of all members
FileSystemWatcher Class Reference

Watches a folder in the file system for changes. More...

Classes

class  Listener
 Receives callbacks from the FileSystemWatcher when a file changes. More...
 

Public Types

enum  FileSystemEvent {
  undefined , fileCreated , fileDeleted , fileUpdated ,
  fileRenamedOldName , fileRenamedNewName
}
 A set of events that can happen to a file. More...
 

Public Member Functions

 FileSystemWatcher ()
 
 ~FileSystemWatcher ()
 
void addFolder (const juce::File &folder)
 Adds a folder to be watched. More...
 
void removeFolder (const juce::File &folder)
 Removes a folder from being watched. More...
 
void removeAllFolders ()
 Removes all folders from being watched. More...
 
juce::Array< juce::File > getWatchedFolders ()
 Gets a list of folders being watched. More...
 
void addListener (Listener *newListener)
 Registers a listener to be told when things happen to the text. More...
 
void removeListener (Listener *listener)
 Deregisters a listener. More...
 

Detailed Description

Watches a folder in the file system for changes.

Listener callbcks will be called every time a file is created, modified, deleted or renamed in the watched folder.

FileSystemWatcher will also recursively watch all subfolders on macOS and windows and will not on Linux.

Member Enumeration Documentation

◆ FileSystemEvent

A set of events that can happen to a file.

When a file is renamed it will appear as the original filename being deleted and the new filename being created

Enumerator
undefined 
fileCreated 
fileDeleted 
fileUpdated 
fileRenamedOldName 
fileRenamedNewName 

Constructor & Destructor Documentation

◆ FileSystemWatcher()

FileSystemWatcher::FileSystemWatcher ( )

◆ ~FileSystemWatcher()

FileSystemWatcher::~FileSystemWatcher ( )

Member Function Documentation

◆ addFolder()

void FileSystemWatcher::addFolder ( const juce::File &  folder)

Adds a folder to be watched.

◆ removeFolder()

void FileSystemWatcher::removeFolder ( const juce::File &  folder)

Removes a folder from being watched.

◆ removeAllFolders()

void FileSystemWatcher::removeAllFolders ( )

Removes all folders from being watched.

◆ getWatchedFolders()

juce::Array<juce::File> FileSystemWatcher::getWatchedFolders ( )

Gets a list of folders being watched.

◆ addListener()

void FileSystemWatcher::addListener ( Listener newListener)

Registers a listener to be told when things happen to the text.

See also
removeListener

◆ removeListener()

void FileSystemWatcher::removeListener ( Listener listener)

Deregisters a listener.

See also
addListener

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