// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Delegate.h"
#include "Engine/Core/NonCopyable.h"
#include "Engine/Core/Types/String.h"
///
/// Action types that file system watcher can listen for.
///
enum class FileSystemAction
{
Unknown,
Create,
Delete,
Modify,
};
///
/// Base class for file system watcher objects.
///
class FLAXENGINE_API FileSystemWatcherBase : public NonCopyable
{
public:
FileSystemWatcherBase(const String& directory, bool withSubDirs)
: Directory(directory)
, WithSubDirs(withSubDirs)
, Enabled(true)
{
}
public:
///
/// The watcher directory path.
///
const String Directory;
///
/// The value whenever watcher is tracking changes in subdirectories.
///
const bool WithSubDirs;
///
/// The current watcher enable state.
///
bool Enabled;
///
/// Action fired when directory or file gets changed. Can be invoked from main or other thread depending on the platform.
///
Delegate OnEvent;
};