FileMonitor Class Reference

#include <filemonitor.h>

Public Types

enum class  STATE : Int {
  RESCAN ,
  MODIFIED ,
  DELETED ,
  METADATA ,
  RENAMED ,
  CREATED
}
 
using Observer = Delegate< void(const Url &watched, const Url &updated, STATE state)>
 

Public Member Functions

enum maxon::FileMonitor::STATE Int MAXON_ENUM_FLAGS_CLASS (STATE)
 

Static Public Member Functions

static MAXON_METHOD Result< FileMonitorItemRef > WatchFile (const Url &url, Observer &&observer)
 
static MAXON_METHOD Result< FileMonitorItemRef > WatchDirectory (const Url &url, Bool watchSubtree, Observer &&observer)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (FileMonitor, MAXON_REFERENCE_NONE, "net.maxon.interface.filemonitor")
 

Member Typedef Documentation

◆ Observer

using Observer = Delegate<void(const Url& watched, const Url& updated, STATE state)>

Member Enumeration Documentation

◆ STATE

enum STATE : Int
strong

Types of CaptureDevices.

Enumerator
RESCAN 

Something in the directory was modified, rescan to find modified files (and check if the directory still exists).

MODIFIED 

The object specified by the URL was modified (write).

DELETED 

The object specified by the URL was deleted.

METADATA 

The attributes and or metadata of the object specified by the URL changed.

RENAMED 

The object specified by the URL was renamed (and possibly moved).

CREATED 

The object specified by the URL was created.

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( FileMonitor  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.interface.filemonitor"   
)
private

◆ MAXON_ENUM_FLAGS_CLASS()

enum maxon::FileMonitor::STATE Int MAXON_ENUM_FLAGS_CLASS ( STATE  )

◆ WatchFile()

static MAXON_METHOD Result<FileMonitorItemRef> WatchFile ( const Url url,
Observer &&  observer 
)
static

◆ WatchDirectory()

static MAXON_METHOD Result<FileMonitorItemRef> WatchDirectory ( const Url url,
Bool  watchSubtree,
Observer &&  observer 
)
static

WatchDirectory description.

Parameters
[in]urlUrl of the directory to watch
[in]watchSubtreeTrue if the function should watch all sub directories.
[in]observerDelegate which is triggered on file change detection.
Returns
FileMonitorItemRef on success. If watchSubtree is true then FileMonitorItemRef might return nullptr if the implementation doesn't support the watching the subtree.