UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModDirectoryWatcher.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric Contributors
3#pragma once
4
5#include "Containers/Set.h"
6#include "Containers/UnrealString.h"
7#include "Templates/UniquePtr.h"
8
9namespace Mod::IO
10{
13{
15 TSet<FString> Names;
17 bool bRescan = false;
18};
19
21class HAL_API FDirectoryWatcher final
22{
23public:
26
29
37 bool Start(const FString& Directory);
38
40 void Stop();
41
47
52 bool IsActive() const;
53
54private:
55 struct FNativeWatch;
56 TUniquePtr<FNativeWatch> Native;
57};
58} // namespace Mod::IO
~FDirectoryWatcher()
Releases the native watch and any pending notifications.
void Stop()
Releases the active registration.
bool IsActive() const
Checks whether the native registration is active.
bool Start(const FString &Directory)
Starts a watch, replacing any previous registration.
FDirectoryWatcher()
Constructs an inactive watch on the calling thread.
FDirectoryChanges ReadChanges()
Takes the available notifications without waiting.
Changes collected from a physical directory since the last read.
Definition ModDirectoryWatcher.h:13
bool bRescan
A scan is needed because the OS could not report all names.
Definition ModDirectoryWatcher.h:17
TSet< FString > Names
Names of changed entries relative to the watched directory.
Definition ModDirectoryWatcher.h:15