ezEngine  Milestone 7
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 Types

enum  Action {
  Added, Removed, Modified, RenamedOldName,
  RenamedNewName
}
 Which action has been performed on a file.
 

Public Member Functions

ezResult OpenDirectory (const ezString &path, ezBitflags< Watch > whatToWatch)
 Opens the directory at path for watching. whatToWatch controls what exactly should be watched. More...
 
void CloseDirectory ()
 Closes the currently watched directory if any.
 
void EnumerateChanges (ezDelegate< void(const char *filename, Action 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...
 

Private Attributes

bool m_bDirectoryOpen
 
ezDirectoryWatcherImplm_pImpl
 

Detailed Description

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

Member Function Documentation

void ezDirectoryWatcher::EnumerateChanges ( ezDelegate< void(const char *filename, Action 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.
ezResult ezDirectoryWatcher::OpenDirectory ( const ezString path,
ezBitflags< Watch whatToWatch 
)

Opens the directory at path 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: