clang 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::DirectoryWatcher::Event Struct Reference

#include "clang/DirectoryWatcher/DirectoryWatcher.h"

Public Types

enum class  EventKind { Removed , Modified , WatchedDirRemoved , WatcherGotInvalidated }
 

Public Member Functions

 Event (EventKind Kind, llvm::StringRef Filename)
 

Public Attributes

EventKind Kind
 
std::string Filename
 Filename that this event is related to or an empty string in case this event is related to the watched directory itself.
 

Detailed Description

Definition at line 66 of file DirectoryWatcher.h.

Member Enumeration Documentation

◆ EventKind

Enumerator
Removed 
Modified 

Content of a file was modified.

WatchedDirRemoved 

The watched directory got deleted.

WatcherGotInvalidated 

The DirectoryWatcher that originated this event is no longer valid and its behavior is unspecified.

The prime case is kernel signalling to OS-specific implementation of DirectoryWatcher some resource limit being hit. Usually kernel starts dropping or squashing events together after that and so would DirectoryWatcher. This means that some events might still be passed to Receiver but this behavior is unspecified.

Another case is after the watched directory itself is deleted. WatcherGotInvalidated will be received at least once during DirectoryWatcher instance lifetime - when handling errors this is done on best effort basis, when an instance is being destroyed then this is guaranteed.

The only proper response to this kind of event is to destruct the originating DirectoryWatcher instance and create a new one.

Definition at line 67 of file DirectoryWatcher.h.

Constructor & Destructor Documentation

◆ Event()

clang::DirectoryWatcher::Event::Event ( EventKind  Kind,
llvm::StringRef  Filename 
)
inline

Definition at line 98 of file DirectoryWatcher.h.

Member Data Documentation

◆ Filename

std::string clang::DirectoryWatcher::Event::Filename

Filename that this event is related to or an empty string in case this event is related to the watched directory itself.

Definition at line 96 of file DirectoryWatcher.h.

◆ Kind

EventKind clang::DirectoryWatcher::Event::Kind

Definition at line 93 of file DirectoryWatcher.h.


The documentation for this struct was generated from the following file: