ezEngine  Milestone 9
ezDirectoryWatcher Class Reference

Watches file actions in a directory. Changes need to be polled. More...

#include <DirectoryWatcher.h>

Classes

struct  Watch
 What to watch out for. More...
 

Public Member Functions

ezResult OpenDirectory (const ezString &absolutePath, ezBitflags< Watch > whatToWatch)
 Opens the directory at absolutePath for watching. whatToWatch controls what exactly should be watched. More...
 
void CloseDirectory ()
 Closes the currently watched directory if any.
 
const char * GetDirectory () const
 Returns the opened directory, will be empty if no directory was opened.
 
void EnumerateChanges (ezDelegate< void(const char *filename, ezDirectoryWatcherAction action)> func)
 Calls the callback func for each change since the last call. For each change the filename and the action, which was performed on the file, is passed to func. More...
 

Detailed Description

Watches file actions in a directory. Changes need to be polled.

Member Function Documentation

◆ EnumerateChanges()

void ezDirectoryWatcher::EnumerateChanges ( ezDelegate< void(const char *filename, ezDirectoryWatcherAction action)>  func)

Calls the callback func for each change since the last call. For each change the filename and the action, which was performed on the file, is passed to func.

Note
There might be multiple changes on the same file reported.

◆ OpenDirectory()

ezResult ezDirectoryWatcher::OpenDirectory ( const ezString absolutePath,
ezBitflags< Watch whatToWatch 
)

Opens the directory at absolutePath for watching. whatToWatch controls what exactly should be watched.

Note
A instance of ezDirectoryWatcher can only watch one directory at a time.

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